View Single Post
Old Nov 25th, 2006, 5:31 PM   #3
codylee270
Unverified User
 
Join Date: Sep 2005
Posts: 209
Rep Power: 0 codylee270 is an unknown quantity at this point
Thanks for the great ideas Arevos:
So, for the random payment method, could I possibly use a random num. generator that produces value 1,2,3. If it comes up with a 1 then his/her payment method is by credit card as long as a variable, such as numCredit != 70% of 1000. And use a 2 for the 20% cash, and 3 for the 10% check? Does that seem viable?

CustomerFactory factory = CustomerFactory(firstnames, lastnames, etc...);

Using this:
for (int i = 0; i < 1000; i++)
{
    customers[i] = factory.newRandomCustomer();
}

What class do the customers belong to? Do they have their own customer class? It looks like you are setting one object equal to another. Should I assume that customers[i] is a customerFactory object?

If I use an array for the deli line, what is the data type of the array? How can I get an array of customers to sort based on each objects' last name data member?

Using this method, which I like, it seems there is a chance that customers may end up wih the same arriva time. I don't know if this is allowed or not, but is there a way to prevent this? It seems that once every customer has an arrival time, preferably unique, you could sort them by arrival, and begin the sim. Again this calls for sorting a list/array based on a data member.

If each customer is to keep track of the time needed to complete transactions and what not, does each customer need a data member to store the time waiting in line?

What functions/data memebers would be in the MegaStore object. What does it use for a counter, a loop? It seems like I would also need some sort of function see the location of a customer ( e.g. the sweepstakes lines, deli line, checkout, -- have they left the store) The counter would need to keep going until the last person is out. How about a bool variable, inStore()?

Could you please elaborate more on how I could keep track of the timing and shuffling in and out of lines/ queues? Again, this is still a mystery to me.


Also, I'm planning on using the STL queues and what not, would you recommend this?

Thanks for everything!
Cody
codylee270 is offline   Reply With Quote