Samenvatting deel 1
This commit is contained in:
@@ -1,6 +1,25 @@
|
|||||||
# Worms #
|
# Worms #
|
||||||
|
|
||||||
### class
|
### inleiding
|
||||||
|
|
||||||
|
e-mail groepsindeling (OK)
|
||||||
|
first part: single class
|
||||||
|
second part: associations between classes
|
||||||
|
third part: inheritance and generics
|
||||||
|
TA voor vragen (ogp-project@cs.kuleuven.be)
|
||||||
|
Engels!
|
||||||
|
Git gebruiken (GitHub)
|
||||||
|
attention: documentation, accurate specifications, re-usability and adaptability
|
||||||
|
|
||||||
|
### Assignment
|
||||||
|
|
||||||
|
2D wereld
|
||||||
|
goal: kill worms of other teams and have the last surviving Worms
|
||||||
|
based on original artillery strategy (1995 by Team17 Digital)
|
||||||
|
eventuele helper classes: classes marked @Value
|
||||||
|
All aspects schould be specified formally and informally
|
||||||
|
|
||||||
|
### Properties of Worms
|
||||||
|
|
||||||
name
|
name
|
||||||
location
|
location
|
||||||
@@ -11,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
### location
|
### location
|
||||||
(x,y) coordinaten
|
(x,y) coordinaten
|
||||||
in meter
|
in meter
|
||||||
defensief
|
defensief
|
||||||
|
|
||||||
@@ -53,3 +72,102 @@
|
|||||||
type niet gezegd -> double (radius, coordinaat)
|
type niet gezegd -> double (radius, coordinaat)
|
||||||
Double.NEGATIVE_INFINITY && Double.POSITIVE_INFINITY toegestaan
|
Double.NEGATIVE_INFINITY && Double.POSITIVE_INFINITY toegestaan
|
||||||
|
|
||||||
|
### Turning and Moving
|
||||||
|
|
||||||
|
### method move
|
||||||
|
change location worm (location, orientation, number of steps)
|
||||||
|
occurs in steps
|
||||||
|
distance one step = radius worm
|
||||||
|
given number of steps >= 0
|
||||||
|
defensief
|
||||||
|
|
||||||
|
### method turn
|
||||||
|
change orientation of worm
|
||||||
|
adding given angle to current orientation
|
||||||
|
nominaal
|
||||||
|
resulting angle in specified range for orientation of worm
|
||||||
|
|
||||||
|
### move and turn costs action points
|
||||||
|
orientation change by 2pi => decrease current action points by 60
|
||||||
|
orientation change by 2pi/f => decrease current action point by 60/f
|
||||||
|
movement: horizontal stap => 1 action points ; vertical => 4
|
||||||
|
total cost step: abs(cos theta) + abs(4sin theta)
|
||||||
|
action point: int (round to next int)
|
||||||
|
|
||||||
|
### Jumping
|
||||||
|
|
||||||
|
### method jump
|
||||||
|
change location (respect orientation and action points)
|
||||||
|
defensief
|
||||||
|
given: remaining action points and mass
|
||||||
|
force jump: F = (5*APs) + (m*g) (g = 5.0m/s^2)
|
||||||
|
duration: 0.5s
|
||||||
|
initial velocity: v0 = (F/m) * 0.5s (formula may change)
|
||||||
|
velocity: nonnegative and finite
|
||||||
|
|
||||||
|
### method jumpStep
|
||||||
|
computes in-flight locations (xDeltaT, yDeltaT) of a jumping worm any deltaT
|
||||||
|
hom compute: page 5
|
||||||
|
distance: d = (v0^2 * sin(2 theta))/g
|
||||||
|
t = d/(v0 * cos theta) (seconds)
|
||||||
|
|
||||||
|
### method jumpTime
|
||||||
|
returns t above
|
||||||
|
orientation: pi < theta < 2pi => worm shall not move
|
||||||
|
jumping: consumes all remaining action points
|
||||||
|
jumpTime and jumpStep must not change attributes of a worm
|
||||||
|
|
||||||
|
### Opmerkingen
|
||||||
|
|
||||||
|
future: involve further trajectory parameters or geographical features
|
||||||
|
|
||||||
|
### Storing and Manipulating Real Numbers as Floating-Point Numbers
|
||||||
|
|
||||||
|
double: store/return arbitrary real numbers
|
||||||
|
double: subset of real numbers (Double.POSITIVE_INFINITY to Double.NEGATIVE_INFINITY)
|
||||||
|
arithmetic operations on double, whose result is double => rounding correct number to obtain a value of type Double
|
||||||
|
idealised JAVA: double same meaning as in regular math
|
||||||
|
correct solution: interpreting your code and formal docu. as statements and expressions of idealised JAVA
|
||||||
|
reasoning: ignore rounding issues
|
||||||
|
testing program: not ignore => result within acceptable distance from correct result
|
||||||
|
acceptable: abs(r-e)/abs(e) < 0.01% (r = observed result, e = expected result)
|
||||||
|
use JUnit's assertEquals(double, double, double) method to test acceptable distance
|
||||||
|
|
||||||
|
### Testing
|
||||||
|
|
||||||
|
write JUnit test suite for move, turn and jump
|
||||||
|
include test suite in your submission
|
||||||
|
|
||||||
|
### User Interface
|
||||||
|
|
||||||
|
GUI to visualise effects of various operations on worms
|
||||||
|
included in assignment as JAR file
|
||||||
|
import JAR into Eclipse as existing project
|
||||||
|
src-provided contains source code of user interface and helper classes
|
||||||
|
no modification form your side
|
||||||
|
developed classes must be placed in src and tests
|
||||||
|
connect implementation to GUI: write class Facade in worms.facade
|
||||||
|
|
||||||
|
### method Facade
|
||||||
|
implements provided interface IFacade from package worms.facade
|
||||||
|
IFacade.java contains additional instructuons on implementation required methods
|
||||||
|
|
||||||
|
### start program
|
||||||
|
run main method in class worms.Worms
|
||||||
|
press keys to modify state of program (see page 7)
|
||||||
|
GUI displays part of space: worms may leave and return to visible area
|
||||||
|
we will test your implementation by running JUnit tests against your implementation of IFacade
|
||||||
|
IFacade shall only throw ModelException
|
||||||
|
incomplete test class is included to show what our tests look like
|
||||||
|
|
||||||
|
### Submitting
|
||||||
|
|
||||||
|
solution: submit jar file (individually by all team members)
|
||||||
|
before 11/03 at 11:59 PM
|
||||||
|
include all source files (including tests) and generated class files
|
||||||
|
include name, course of studies and link to your code repository in comments of solution
|
||||||
|
|
||||||
|
### Feedback
|
||||||
|
|
||||||
|
TA will give feedback
|
||||||
|
feetback sessions between 19/03 en 30/03 (Toledo)
|
||||||
|
Reference in New Issue
Block a user