19) Final Tests

9) Final Tests


Date: 12/06 2012
Group members participating: Falk, Jeppe and Jakob
Duration of activity: 7 hours

9.1) Goal

Make the final tests before the presentation.

9.2) Plan

  • Test sensors at 11 o'clock.
    • Hopefully the lighting will be the same as on the presentation day.
  • Run a full test to see what needs changing.
    • Tweak values to make the preys behave more animal like.
  • The cables still causes small problems, and they look weird.
  • Sounds for the preys and the predator needs to be modified.

9.3) Results

9.3.1) Predator Sounds

The following sounds are added to the predator:

Event Sound
Connects Play 'Imperial March'.
Hits Hammer sound.
Exit Evil laugh.

9.3.2) Prey Sounds

To make it easier to play sounds for the prey a SoundPlayer class has been implemented. This class has the responsibility to play all sounds, and has methods for each behavior e.g. playEatFoodSound (int d). The d (for duration) is not a part of all the methods, but if it is, the behavior uses the play[behavior]Sound (e.g. playEatFoodSound) to wait while driving or turning. In this waiting period the behavior can still be interrupted if another behavior has higher motivation.
The following sounds are implemented:

Behavior Sound
Eating Blip-blop rising in frequency as the hunger decreases.
Running away Scream like crazy.
Hitting bordor Making a sound while on the border.
Backbumper blip-blop with a relative high frequency and high occurance.
Avoid obstacle Makes a sound at the start of the behavior.
Wander around Makes no sound.

9.3.3) Full Test

A full test of all preys and the predator interacting on the track, the following issues arose during the test:

  • After a prey robot is done eating, it seems to think the back bumper is pressed.
    • The motivation value shown in the display looks as if the robot is running forward after the back bumper was pressed, but it sounds like the back bumper is pressed all the time.
    • This might have something to do with the delay that is built in to the SoundPlayer.
    • It could also be a problem that was there all along, i.e. before the SoundPlayer was implemented.
    • After removing all the sound-playing-mechanisms the error is still there, so it must be a problem that was there all the time.
    • It could be a thread problem, but removing some of the behaviors still caused the problem.
    • The problem seemed to be that when two behaviors had the same motivation, and the new behaviors motivation was 0, the priority did not matter.
    • The problem was solved by adding that a behavior has to have a higher motivation than zero to be able to be run by the arbitrator.
public void run() {
    while (running) {
         * If no previous maxBehavior exist or the new 
         * behavior has higher motivation or if to behaviors 
         * are tied for motivation and the new has higher 
         * priority.
        if (maxBehavior == null 
            || motivation > maxMotivation
            || (motivation == maxMotivation 
                && maxBehavior.getBehaviorPriority() > 
                && motivation > 0) {
            // A new behavior has taken the lead.
            maxBehavior = currentBehavior;
  • When the preys get scared from seeing the predator, they might run across the border without noticing.
    • This is because the readings from the color sensors are not that reliable, as the sensor depends much on the surrounding light.
    • The sensors were adjusted to be a few millimeters above the track. This works best at the time of day the presentation is to be.

9.4) Conclusion

After debugging and tweaking the prey robots are better at staying inside the track and behave more animal like. The only thing missing is to prepare the final presentation.

The preparation was done the next day, and will not be part of the report, but the some of the diagrams can be seen in the final conclusion.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License