Download presentation
Presentation is loading. Please wait.
2
Design, Implementation, & Impact Jeffrey Santos Hofstra University May, 2010
3
Introduction Robocode Presentation Goals Presentation Organization
4
Project Specifications Objectives 1. To design a robot that will effectively destroy CrazyBot 2. To design a tracking algorithm that will accurately predict CrazyBot’s movements based on observations 3. To design a shooting algorithm that will accurately predict where CrazyBot will be when a bullet passes through a potential area of contact
5
Project Specifications Functional Requirements 1. The robot program should compile and be loadable by the Robocode program. 2. The robot should handle the following events: a) When the radar detects the presence of an enemy robot. b) When the radar no longer detects the presence of an enemy robot. c) When the robot hits a wall or enemy robot. d) When the robot is hit by a bullet
6
Project Specifications Non-Functional Requirements 1. In a one-to-one battle against CrazyBot, the hit-ratio should be at least 75%. 2. In a one-to-one battle against CrazyBot, the energy level of the robot should be at least 90% when the battle is completed. 3. In a group of ten battles against CrazyBot, the average time to victory should be less than 1200 turns. 4. In a group of ten battles against CrazyBot, the robot should be victorious 100% of the time.
7
The Algorithms Tracking Movement Targeting Unwritten Rule: Stay Simple!
8
The Algorithms:Tracking Keep a detected robot in the radar arc at all times. Generous radar arc allows for very simple design. Delegated to targeting algorithm.
9
The Algorithms:Movement 1. Calculate enemy energy changes. 2. Calculate distance between CrazyDestroyer and target enemy robot. 3. If the energy change is between 0.0 and 3.0, the enemy likely fired on CrazyDestroyer, move at an angle orthogonal to the bearing to the enemy robot a distance of 50 pixels. 4. If the enemy is greater than 300 pixels away from CrazyDestroyer, move towards it.
10
The Algorithms: Targeting Finding a Circle
11
The Algorithms: Targeting A “Perfect” Algorithm Mathematically “Perfect” Too complex
12
The Algorithms: Targeting A Discrete Solution Method of Exhaustion Discrete Sampled Points
13
The Design
14
The Design *Data
16
The Design Circular Path
17
The Design DataControlSystem
18
The Design TrackingControlSystem
19
The Design CrazyDestroyer
20
Implementation & Testing Robocode 1.7.1 API Sun Microsystems’ Netbeans 6.8
21
Implementation & Testing Design Changes The Geometer Class Changes to DataControlSystem BattleData.calcEnemyPosition()
22
Implementation & Testing Major Bugs Encountered Departure from a normal relative angle Data storage and retrieval
23
Implementation & Testing Unit Testing CircularPath.calcPosition Geometer.getAngle Geometer.calcCircumcenter Note on Division By Zero
24
Implementation & Testing Unit Testing: CircularPath.calcPosition PointHeadingVelocityTimeExpected (0,0)111(0.8414, 0.5403) (0,0)11(-0.8414, -0.5403) (3, 4)π/412(4.412, 5.4142) No Exceptions!
25
Implementation & Testing Unit Testing: Geometer.getAngle VertexABExpected (0,0)(0,3)(3,0)π/2 (0,0)(3,0)(0,3)π/2 (0,0)(0,3)(0,-3)π (0,0) (0,3)NaN/Infinity (0,0)(0,3)(0.00001, 3)0.000003 The domain of arccosine…?
26
Implementation & Testing Unit Testing: Geometer.calcCircumcenter ABCExpected (0,1)(1,0)(0,-1)(0,0) (0,1)(0,-1)(1,0)NaN/Infinity (0,1)(0.00001, 0.9999)(1,0)(-0.1111, 0.1111) (1,0)(-1,0)(0,1)NaN/Infinity (0,1)(1,0)(-1,0)(0,0) (0,1)(1,2)(2,3)NaN/Infinity (0,1)(1, 2.00001)(2,3)(10000001, -9999998)
27
Experimental Results Experimental Variables Battlefield Size Movement Algorithm Gathering Data The DataControlSystem 100,000 Trials
28
Experimental Results Battlefield Size Discrepancies
29
Experimental Results Movement Algorithm Discrepancies 400x400 Battlefield Constant movement Collisions 800x600/1200x1200 Battlefield High success Successful by design 5000x5000 Battlefield
30
The Pedagogy of Robocode Robocode: Assessment For Learning Extending Robocode to meet the full requirements of an Introductory level Computer Science curriculum Focus on Secondary Education
31
Conclusions The Effectiveness of CrazyDestroyer The Pedagogy of Robocode
32
References [1]“Alice”, available at http://www.alice.org/, retrieved 04/11/2010. [2]“A Model Curriculum for K-12 Computer Science”, CSTA, available at http://www.csta.acm.org/Curriculum/sub/CurrFiles/K-12ModelCurr2ndEd.pdf, retrieved 04/11/2010. [3]Clark Aldrich. Learning Online with Games, Simulations and Virtual Worlds: Strategies for Online Instruction. Jossey-Bass, 2009. [4]“Computer Science A Course Description”, CollegeBoard AP, available at http://apcentral.collegeboard.com/apc/public/repository/ap-computer-science-course-description.pdf, retrieved 04/11/2010. [5]Douglas Fisher and Nancy Frey. Checking for Understanding: Formative Assessment Techniques for Your Classroom. Prentice Hall, 2007. [6]Mathew Nelson, "Robocode", available at http://robocode.sourceforge.net/, retrieved 04/11/2010. [7]Robert J. Marzano, Debra J. Pickering and Jane E. Pollock. Classroom Instruction That Works: Research-Based Strategies For Increasing Student Achievement. Prentice Hall, 2004. [8]“Scratch”, available at http://scratch.mit.edu/, retrieved 04/11/2010.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.