Robot controller simulator using concurrent programming in Java. Project for Operating Systems module (2nd year Computer Science).
- Implement a concurrent programming approach for handling tasks performed by a robot.
- Understand how multithreadding works and apply it to a Java program.
- Identify bottleneck found in one of the robot components
Documentation on the approach taken to build this controller is found in the pdf 'Operating_Systems_Coursework_1.pdf'
build and run shell scripts are provided to compile and run the project.
- cd into directory
./build.sh
./run.sh
This robot controller simulator will divide the robot in 3 main components:
The sensor component will generate tasks every second, where every task will have a Task ID and a Task complexity given by 0.1
Where k will be the ammount of tasks generated in 1 second (batch).
The analyser will collect tasks generated by the sensor, retrieved from a blocking queue (shared resource) and will "analyse" each task,
converting the task complexity to time
thread.sleep(complexity)
The actuator will collect tasks analysed by the analyser, retrieved from a blocking queue (shared resource) and will "process" each task, converting the task complexity into distance to move the robot, given by the formula:
The robot will move within the distance range [0, 1], and will bounce back when reaching the "walls", changing direction in case it has remaining distance to move left
In task 2, multiple sensors will fire tasks generated to one analyser, and I will observe what is the effect on the overall controllers throughput when this happens.
More details on the general implementation decisions found in the Documentation.