This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

joandvgv6
joandvgv6 presents ...

2015/2/21

Garbage collection simulation

This will show you how the garbage is collected in a city.
There are 5 routes in the scenario.
Each route has a pre assigned path and just one truck at a time will roll over it.
Just press "Empezar" -Start- It will ask for the number of trucks first. You should add a minimun of two trucks to start. (5 recommended so each route has a truck assigned to it)

Then it will ask for the route frequency. This is how often a truck will be dispatched in order to roll over a route.
Smaller numbers mean more often (being 1 too often)

Next, it will ask for how many days you want the simulation to run. Each day lasts around 90 seconds.
Try to adapt this to the frequency. For example, if you choose too often and then 6 days. Since the frequency is too high, all of them will be completed within 1 or 3 days, so there will be 3 days left with no movement at all.

There's one "inspector truck" that starts at the begining of the Simulation. This one roll over all the routes.
If one truck could not complete its route, and there are available trucks, one should go and end it.

At the end of the simulation there are some statistics, where you can see (in this order)
Number of times garbage was not collected. (Even if it was collected before)
Number of times garbage was collected.
Number of extra trucks collected (it will be 0 if garbage is always collected)
Amount of garbage collected.

1324 views / 353 in the last 7 days

Tags: simulation with-source

open in greenfoot

There is no HTML 5 translation of this scenario available.
View legacy version (requires Java plugin)

This scenarios uses Java features that are not available for use after conversion to HTML 5. Please try the legacy version, which requires the Java plugin to be installed.

joandvgv6joandvgv6

2015/2/21

Here's the entire project dan. The code is a mess but i Hope you like it.
fejfofejfo

2015/2/21

maybe English instructions?
joandvgv6joandvgv6

2015/2/21

Yes! I forgot about it because I uploaded this as quick as I could.

Want to leave a comment? You must first log in.

Who likes this?

No votes yet.