• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to manipulate the value in this simulation code  RSS feed

 
Carla Lee
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys..

I'm a newbie in java and I try to understand the logic of this simulation

I want to control the arrival value of the customer and server.

There is no error but the result is mess up. The code did not match with the logic of simulation.  Can anyone help me?



This is the code that I put inside:





This is the initial code:


 
Swastik Dey
Rancher
Posts: 1812
15
Android Eclipse IDE Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the expected output and what is the obtained output?
 
Carla Lee
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swastik Dey wrote:What is the expected output and what is the obtained output?





This is the result after I put some of the code.
You can see the Total customers arrived: 472. 
But it suppose to be only 400 right?



I want to calculate the average waiting time for each of the arrival. But i'm stuck. :/

 
Campbell Ritchie
Marshal
Posts: 56529
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That isn't newbies' code. How much programming have you actually been taught?
I am afraid the code is too large for any of us to debug. I think you are going to have to go through the code yourself. Put some print statements in it, so you will know which method is being called when. Also put some counter variables, which will count how many times a particular method is called. That shou‍ld give you a start.

Why are all your methods marked static? Why have you written such long lines? Why do you appear to have documentation comments in the middle of methods? Why are your methods so long? Have you written down the algorithm you are simulating?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!