Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Summative Coursework Set Front Page

1. Assignment description

You are to develop a simulation of a variety of different robots and other objects moving round an arena and displayed this in a graphical user interface. You are free to add features to your Robot Simulation code.

1.1. Console version description

In sections 3, 4, and 5 you will develop the classes needed to create a simulation of robots moving around an area, displayed in a console window. The classes to be written are specified in detail in the lab sheets for these sections. The works are to be submitted as a formative assessment for the feedback.

1.2.  GUI version description

The work is inspired by the code written in sections 3, 4 and 5 of the console version in which you had only one type of robot moving around the arena in a console interface. However, in GUI version, you will need to do a proper object-oriented design with a suitable hierarchy of classes, including at least one abstract class.

You must utilise the JavaFx GUI library which you will learnt about in sections 6 and 7. The GUI should have menus, a toolbar with buttons and an information panel – as set out below.

Application Menu

The application should have a suitable menu, which allows the arena to be configured, saved and edited, that allows the simulator to run, and to provide help and instructions.  You can make design choices about the menu items, as long as you describe these choices in the design section of the report.

File Handling and Configuration

The application should allow the user to save and load simulation configurations from files. A configuration is defined as the set of parameters required to set up and start a simulation. By default, the simulator should load from a user defined configuration file, but if one is not there then a default arena with at least three robots or different items should be provided.

Toolbar

Also required is a toolbar with buttons to control the simulation (e.g., start, pause, add robots, etc.).

Information Panel

As the simulation runs, information should be provided on the state of the arena and its contents – these could be textual descriptions, but graphs or other displays may also be appropriate.

Classes and Inheritance

The classes for the console simulation were tightly specified, but you have more freedom for the GUI version, and so you should employ suitable design strategies. See below for hints.

The code should make use of at least one abstract class which is inherited directly or indirectly by other classes – the abstract class could be used by robots and other devices in the arena. Pay special attention to your use of inheritance and use access modifiers correctly. You should also have a class for the GUI, one for a canvas and one for the arena.

Animation

You can use any method, as long as you use JavaFX, to achieve the animation. In the console version, robots move either North, South, East or West. For the GUI version movement should not be constrained to these four directions – see the Ball examples.

Comments, documentation and version control

Your code should be professionally laid out and commented using Javadoc style comments.

Hints on Simulation

A rich simulation is expected, comprising a variety of robots with different behaviour and other items in the arena.

Robots could operate at different heights, and so when showing the arena, you draw all those at low levels, before those at higher ones. This could be done by repeatedly scanning through all the robots, until all have been drawn, but only drawing a robot if there is none below it – and then remembering it has been drawn. You could try drawing it in 3D if you wanted!

It is perhaps best to have a robot which is like that in the console, namely if it cannot move in its current direction because of a wall or another object, it turns. In effect it has a ‘bump’ sensor.

There should also be robots with different types of sensor – perhaps detecting obstacles a certain distance away. You could have sensors which detect lights, or even charging stations.

You could have obstacles in the way, and so a robot would have to steer to avoid an obstacle or rise up to go over it.

You could have robots which are predators of other robots.

You could have a robot which the user of the simulation controls.

You might find it easier if you make all robots/obstacles circular as it is easy to work out if they overlap. You can then use some of the concepts in the ball simulation.

You are free to give a game like theme e.g., robots in a war zone, a pizza delivery robot in a city,  or any other theme you may wish.

Key point

You must have at least one abstract class, possibly one which defines an object in the arena which all robots and other obstacles extend, or a robot abstract class which more sophisticated robots extend (as per the ball example).

It is important therefore that you do a full object-oriented design early on, before implementing the different robots. You must this submit the classes design in your report showing the hierarchy of classes you have implemented. See also comment below as regards the final report.

Suggested Development Plan

In sections 6 and 7 you will learn about using JavaFX and about inheritance, and in section 8 there is more detail on inheritance including the use of abstract classes. In the lab session in section 6, you learn about JavaFX and in section 7 model a simple solar system with planets and moons. At that stage you will know about developing a GUI, with menus, mouse clicks, buttons and animation.

In section 6 you should start the GUI version of the robot simulator (but section 6 folders open in section 6 so you can keep yourself ahead). It is strongly suggested that you create a GUI, based on that in the solar system, but for robots. So have classes for GUI, canvas, robot arena and robot, and ensure that you have a robot which moves around the arena, perhaps turning when it reaches a wall of the arena, showing itself in the canvas of the GUI. Then have an array list of robots, and now the robots turn if they are about to encounter a wall or another robot. If you want to, have an abstract class for an item in the arena, which is inherited by your robot class. You could also have static obstacles which are in the class which if encountered by robots cause the robot to turn.

For the session in section 7, perform an object-oriented design covering the various robots and other obstacles that will be in your arena, including at least one abstract class. This could be similar to the figure on slide 5 of the “JavaWeek 9 AbstractClasses” powerpoint – showing the classes, key data and inheritance.

Implement some of the classes in section 8, and the rest in section 9, adding functionality such as file handling (for which it is recommended that you make your classes serializable so you can load or save an arena of robots in one go).

2. Assignment submission requirements

There are two mandatory submission points, 1- console version (20%) and 2- GUI version (60%).