Skip to content

Simulation of the cleaning process built with OOP principles

Notifications You must be signed in to change notification settings

zshanabek/cleaning_simulation

Repository files navigation

Cleaning Simulation

Screenshot

This program is a simulation of cleaning. In a frame there are cleaners and many dirts. Cleaners (big circles) move and try to touch dirts (little particles). If they touch a dirt, then numberOfDirtsCleaned is incremented. Each cleaner saves own numberOfDirtsCleaned value.

There are two types of moves (move strategies):

  • MoveToDirtStrategy. This strategy gives a cleaner ability to move to the closest dirt.

  • MoveRandomStrategy. This strategy just shakes a cleaner.

Cleaners change their moving strategy after every strategySteps steps. The last variable is given as a command line argument

Clone project

git clone https://github.com/zshanabek/cleaning_simulation

Compile project

$ cd cleaning_simulation
$ javac SimulationRunner.java
$ java SimulationRunner
Usage: CleanSim <Width><Height><NumberOfDirts><NumberOfCleaners><StrategySteps>

Run with command line arguments

java SimulationRunner 800 600 500 8 30

About

Simulation of the cleaning process built with OOP principles

Topics

Resources

Stars

Watchers

Forks

Languages