Commit Graph
181 Commits
Author SHA1 Message Date
hba56 2a7f264444 Merge remote-tracking branch 'remotes/origin/sprint4_master' into story36
# Conflicts:
#	visualiser/src/main/java/seng302/Controllers/RaceController.java
#	visualiser/src/main/java/seng302/Model/ResizableRaceCanvas.java
#story[878]
2017-05-23 13:19:11 +12:00
hba56 7c9b9c6426 Merge commit message was wrong, i wasn't watching the start up time
-small fix to java doc
#story[878]
2017-05-22 17:56:47 +12:00
hba56 748a516d16 Boats not moving working on fix
Merge remote-tracking branch 'remotes/origin/sprint4_master' into story36

# Conflicts:
#	mock/src/main/java/seng302/DataInput/XMLReader.java
#	visualiser/src/main/java/seng302/Controllers/RaceController.java
#	visualiser/src/main/java/seng302/Mock/StreamedRace.java
#	visualiser/src/main/java/seng302/Model/ResizableRaceCanvas.java
#	visualiser/src/main/resources/scenes/race.fxml

#story[878]
2017-05-22 17:45:45 +12:00
Joseph Gardner 06359fb138 Had to changed race to fit the merge 2017-05-22 16:39:26 +12:00
Joseph Gardner 40421e5a83 Merge branch 'sprint4_master' into noDependencyArrow
# Conflicts:
#	mock/src/main/java/seng302/Model/Race.java
#	network/src/main/java/seng302/Networking/Messages/RaceStatus.java
#	visualiser/src/main/java/seng302/Controllers/RaceController.java
#	visualiser/src/main/java/seng302/Model/ResizableRaceCanvas.java
#	visualiser/src/main/resources/scenes/race.fxml
2017-05-22 15:28:53 +12:00
fjc40 c8157f3476 Merge remote-tracking branch 'origin/sprint4_master' into story31.2_alternateTack
# Conflicts:
#	visualiser/src/main/java/seng302/Mock/StreamedRace.java
#	visualiser/src/main/java/seng302/Model/ResizableRaceCanvas.java
Resolved.
2017-05-22 14:26:45 +12:00
hba56 abcaca719c Javadoc fix
#story[878]
2017-05-22 11:05:36 +12:00
fjc40 de0abf94e0 Mock.Race:
Fixed an issue where boats sometimes sailed towards the wind when attempting to turn from bearing just under 360 degrees to a bearing just over 360 degrees.
This required an update to the boundary detection code.

Visualiser:
Appear to have fixed issue where clock didn't display correctly. Previous commit only fixed certain circumstances.

#story[873]
2017-05-20 00:18:42 +12:00
fjc40 c011ccb11b Did some minor refactoring of Mock module...
Added comments/documentation to most classes.
Cleaned up heaps of repeated code, dead code, redundant stuff, etc...

Mock.App:
Now actually exits the program if catastrophic errors occur, rather than silently doing nothing.

Mock.Constants:
Added race prestart and preparatory times.
Removed TEST_VELOCITIES.

Mock.PolarParser:
Now uses Bearing class.

Mock.Angle:
Now implements the Comparable interface.
Also supports .equals.

Mock.Azimuth and Bearing:
Can convert between them easily.

Mock.Boat:
Now uses Bearing, and has some helper functions like setVMG, calculateMetersTravelled(time), moveforwards(distance, time).

Mock.Marker:
Removed. This wasn't really used, and was redundant.

Mock.GPSCoordinate:
Moved a lot of helper GPS related functions into the GPSCoordinate class, instead of being scattered around the codebase.

Mock.Polars:
Polars now uses Bearing.

Mock.VMG:
Now uses Bearing.

Mock.Race:
Added a RaceStatusEnum member.
Added a RaceTypeEnum member.
Now uses Bearing/Azimuth.
Moved the message creation/sending into their own functions.
The RaceStatus updates correctly through out the race (Prestart, Warning, Preparatory, Started, Finished).

Network.RaceStatusEnum:
Added race status enum.

Network.RaceTypeEnum:
Added.
2017-05-19 16:12:47 +12:00
fjc40 a0468f251b Merge remote-tracking branch 'origin/story33-estimateTime' into sp4_s31_cleanups
# Conflicts:
#	mock/src/main/java/seng302/Model/Race.java
Resolved.
2017-05-18 23:41:17 +12:00
fjc40 aa7337dc6c Merge branch 'story31.2_alternateTack' into sp4_s31_cleanups
# Conflicts:
#	mock/src/main/java/seng302/Model/Race.java
Resolved conflict manually.
2017-05-18 17:16:06 +12:00
fjc40 d88c353213 Brought in some fixes from the story31.2_merge branch. 2017-05-18 17:03:52 +12:00
fjc40 cc54c92d5b Added Mock.Angle, Mock.Azimith, Mock.Bearing. These encapsulate the relevant angle type, to allow for better type safety (e.g., to avoid passing a bearing into an azimuth function).
Added more comments to Mock.Boat.
Moved calculateAzimuth to GPSCoordinate, from Boat.
2017-05-18 14:49:56 +12:00
cbt24 27d4040a54 Cleaned up updatePosition in Mock.Race to simplify time estimation.
#story[875]
2017-05-18 14:42:27 +12:00
fjc40 60458f0f7a Merge commit '7990ac9d2ee8c71d50606813e21a0674f442464f' into story31.2_alternateTack.
This commit (7990ac9d2e) was the commit from master that story49 was merged into.
Everything appears to be working.

# Conflicts:
#	mock/src/main/java/seng302/App.java
#	mock/src/main/java/seng302/Constants.java
#	mock/src/main/java/seng302/DataInput/RaceXMLReader.java
#	mock/src/main/java/seng302/DataInput/RegattaXMLReader.java
#	mock/src/main/java/seng302/Model/Boat.java
#	mock/src/main/java/seng302/Model/Event.java
#	mock/src/main/java/seng302/Model/Race.java
#	mock/src/test/java/seng302/Data/BoatDataTest.java
#	mock/src/test/java/seng302/Data/RaceDataTest.java
#	mock/src/test/java/seng302/Model/BoatTest.java
#	mock/src/test/java/seng302/Model/RaceXMLTest.java
#	visualiser/src/main/java/seng302/Controllers/StartController.java
#	visualiser/src/main/java/seng302/RaceXMLReader.java
Manually resolved conflicts. :(
2017-05-18 13:44:02 +12:00
zwu18 7d27a098ac Fixed wind direction code missing due to past merges (?)
#story[882]
2017-05-17 18:13:20 +12:00
fjc40 0c790c1721 Mock.Polars:
Was accidentally using testng in the PolarsTest. Changed it to junit.

#story[873]
2017-05-17 13:48:05 +12:00
fjc40 be9f19eae5 Mock.Polars:
Finished PolarsTest test cases.

Fixed a number of javadoc errors across the codebase.

#story[873]
2017-05-17 13:33:34 +12:00
David Wu f999967cd5 Implemented functionality for sparkline to update throughout race.
-Sparkline reads in initial boats in race.
-Sparkline updates throughout the race.
-Sparkline updates are displayed on GUI.

#story[876]
2017-05-16 17:13:52 +12:00
fjc40 00c9cb2c83 Mock.PolarParser:
Fixed some javadoc issues
2017-05-15 18:49:57 +12:00
fjc40 656212d06d Mock.Race:
Fixed an issue in updatePositions(...) where unconstrained bounds could be passed into the calculateVMG function (e.g., lower = -182391, upper = 188221), but they need to be in the interval [0, 360).

Mock.Polars:
Added more test cases. Still working on getting the assertions correct.
Refactored and bugfixed the calculateVMG(...) function. There were a few bugs (and ugly "fixes") because we didn't bother enforcing a strict interval on the lower and upper bound angles.
Also added a few more comments to explain the function better.

#story[873]
2017-05-15 18:39:38 +12:00
Joseph Gardner 5d34b49316 Merge branch 'master' into submission
# Conflicts:
#	mock/src/main/java/seng302/Model/Race.java
#	mock/src/test/java/seng302/Model/RaceTest.java
#	visualiser/src/main/java/seng302/Model/ResizableRaceCanvas.java
2017-05-15 16:08:46 +12:00
Fan-Wu Yang b065b8d9c7 Merged Mock49 and fixed bugs
- Error where mock would not read in the files when running from the jar.
- Error where the AC35 stream now no longer sends us packets with information that is set for 0 for boat location.
#story[881] #pair[fwy13, esa46
2017-05-15 15:49:38 +12:00
hba56 12b6f49f2e boats now bounce on the boundry
#pair[hba56, cbt24, jjg64]
 #story[873]
2017-05-15 15:21:45 +12:00
fjc40 572e54b076 Mock.Race:
An alternate tacking implementation during race simulate. Doesn't handle keeping the boats in-bounds, and sometimes has issues with landing directly on a mark.
Also seems to use wrong starting velocities (from the XML file).

#story[873]
2017-05-15 14:13:36 +12:00
Joseph Gardner 93c539b68b mock pom had the name visualiser 🤔 2017-05-15 11:42:42 +12:00
zwu18 0291726589 Added test for changing wind direction.
#story[882]
2017-05-15 02:10:44 +12:00
fjc40 f4d5df9df2 Mock.Polars:
Fixed a bug where calculateVMG was placing velocity into the VMG object, instead of speed.
Maybe fixed a bug when a bearingLowerBound which is greater than bearingUpperBound is provided.
Added another test case.

Mock.Constants:
Added knots to millimeters per second conversion factor.

Mock.Boat:
Added calculateDIstanceToNextMarker function, which returns the distance, in nautical miles, to the next mark.

Mock.Race:
Added wind direction as a race property.
Added wind speed as a race property.
The race status messages sent by Race now use Race's wind speed and direction.

#story[873]
2017-05-14 22:34:05 +12:00
fjc40 7f37dbbcb5 Mock.Race:
Usages of VMG.bearing now use the getBearing() function, as the member is now private.

#story[873]
2017-05-14 17:54:27 +12:00
fjc40 c2f487b06d Merge branch 'story31.2' of eng-git.canterbury.ac.nz:seng302-2017/team-7 into story31.2 2017-05-14 17:44:46 +12:00
fjc40 6f2c5d6c40 Mock.VMG:
made speed and bearing members private - had accidentally forget the visibility specifier.

Mock.Polars:
Added linear interpolation between speed values (e.g., if the wind speed is 15.9kn, it will interpolate between the 12kn and 16kn data). This allows for wind speeds less than 4kn (the lowest wind speed in the data file). It does not extrapolate anything for wind speeds larger than 30kn (the largest wind speed in the data file).
Also refactored some of the code into some interpolation functions.

#story[873]
2017-05-14 17:43:34 +12:00
hba56 3895172631 updated the race class to set heading for windward legs
#story[873]
2017-05-14 17:25:44 +12:00
hba56 d4be901b1a Merge remote-tracking branch 'origin/story31.2' into story31.2 2017-05-14 15:16:18 +12:00
fjc40 2dc17a688f Mock.Polars:
Fixed a bug where duplicate estimates could be added to the Polar table (this happened when the angle was 0, so the "negative" angle became 360, which is equivalent).
Now has a list of angle values for each wind speed, rather than checking if Pair<WindSpeed, WindAngle> exists in the map.
calculateVMG now uses linear interpolation between two adjacent angles (e.g., if data file contains angles 0, 30, 45, etc.. it can interpolate and find an optimal VMG angle between those, for example, 17 degrees).
Added a third test for when we provide a wind speed which is lower than any wind speed values in the Polars table. Still need to actually calculate correct VMG values by hand.

#story[873]
2017-05-14 01:12:36 +12:00
fjc40 6f9249e238 Mock.PolarParser. Fixed a bug where it would only parse the first half of each row.
Mock.Polars. addEstimate also builds up a unique list of angles from the data file, instead of dynamically generating that when calculating a VMG.
addEstimate also adds estimates with negative angles (e.g., 45deg+windSpeed+boatSpeed, and -45deg+windSpeed+boatSpeed).
calculateVMG now accepts an upper and lower bounds to the allowed VMG bearing it returns - this way you can get VMGs only within a certain angle interval (e.g., [16, 99] degrees).
Also fixed some bugs in calculateVMG where it wasn't actually using the angles and such correctly.
Improved the test case slightly, but still need to calculate correct values by hand.

#story[873]
2017-05-13 17:10:06 +12:00
hba56 dd1308808a updated the race class to set heading based on the vmg not just the end of a leg
-race class now stores the boundary
-updatePositions now checks if the boat is with the course
-update positions now sets heading and speed based on the vmg
-updated azimuth to now accept a start and finish gps rather that finding it itself
-added a calculatebearingtodestination method that finds the azimuth to the dest from the boat
-updated boat tests to use the new azimuth method
 #story[873]
2017-05-12 12:49:02 +12:00
Joseph Gardner 04fdeaf2e2 Optimised boundary checking #story[873] 2017-05-12 11:58:31 +12:00
zwu18 a91bc459f7 Implemented functionality for mock to parse marker boats throughout race.
-Added getter to CompoundMark to get the Mark value.

#story[881]
2017-05-12 02:10:17 +12:00
Erika Savell 5708db1936 Ignoring all new race tests
- Thought they they would be ok bc not calling animation timer directly
- Was mistaken

#story[881]
2017-05-11 16:33:00 +12:00
Erika Savell 799e588145 Unignored a couple of GPS tests
- The issue was with accuracy. Average of two coords is fine fo two point fairly close together (<1km), but not for very very large distances.
- We only ever use it for small ranges so changed tests to reflect that

#story[881]
2017-05-11 16:01:44 +12:00
Joseph Gardner eca6b7e374 Fixed imports 2017-05-11 15:57:54 +12:00
Erika Savell 11f6dee301 Added a number of race tests.
- Still unable to get animation timer tests working. May be necessary to make handle() hold nothing but a method call

#story[881]
2017-05-11 15:43:12 +12:00
Joseph Gardner 602bc0686e Changed public functions in the RaceXMLReader to make a new list every time and reassign the list to avoid duplicates in a list. #story[873] 2017-05-11 14:55:50 +12:00
Joseph Gardner 8c0c03dcf2 Fixed tests that were reading the file again making them fail. #story[873] 2017-05-11 14:49:17 +12:00
Joseph Gardner a13899b6a7 Implemented and tested to check if a point is inside or outside of a boundary using a ray tracing algorithm. The function is public static for a GPSCoordinate and takes a list of GPSCoordinates and the comparing coordinate. #story[873] 2017-05-11 14:40:24 +12:00
Erika Savell 0bb18c7957 Temporarily ignoring animation tests
- The VMs don't have the necessary libraries to run them

#story[881]
2017-05-11 13:34:26 +12:00
fjc40 3b2f99b7d7 Fixed Polars.calculateVMG function - it was using non-existent keys in some circumstances.
#story[873] #pair[fjc40,jam339]
2017-05-11 11:58:02 +12:00
fjc40 238b97c016 Added a VMG class (has a speed and bearing).
Added the Polars.calculateVMG function, which calculates the VMG from a given wind angle, wind speed, and angle to destination. In may not be completely correct at the moment, so it's a work in progress.

#story[873]
2017-05-11 11:30:18 +12:00
Erika Savell 892bfd9676 Began on tests for Race class.
- Made really good progress using Mockito and calling .handle() on animation timers

#story[881]
2017-05-11 01:22:28 +12:00
Erika Savell fd036c1835 Refactored countdown timer in race class
- Also fixed all boats having ame velocity

#story[881]
2017-05-11 00:51:34 +12:00