Many environments have the property that there are several paths that lead to the same state.
The project contains a State class that could be thought of implementing a state of some robot. The state consists of a position, an orientation and a boolean holding the information of whether or not the robot is turned on. The project also contains code to test how good the hashCode() method of the State class is. To run the tests simply run the Main class or use “ant run” on the terminal.
s1
and s2
that you'd consider the same, s1.equals(s2)
must return true and false otherwise.o1
and o2
, if o1.equals(o2)
then o1.hashCode() == o2.hashCode()
must be true!As with all the labs, you can work in groups of up to 4 students.
Hand in a zip file containing:
To create the zip file you can just edit the “student” property in the build.xml and call the “zip” target using ant (execute “ant zip” in the directory containing the build.xml).