@Test public void testRapidResponseWithTwoSurfarceDriftPoints(){ SAROperation operation = new SAROperation(SAR_TYPE.RAPID_RESPONSE); DateTime now = DateTime.now(); DateTime lastKnowPositionTs = now.minusHours(1); Position lastKnowPosition = Position.create(61, -51); DateTime css = now; double x = 0.1; double y = 0.1; double safetyFactor = 1.0; RapidResponseData data = new RapidResponseData("1", lastKnowPositionTs, css, lastKnowPosition, x, y, safetyFactor, 0) ; List<SARWeatherData> surfaceDriftData = new ArrayList<>(); surfaceDriftData.add(new SARWeatherData(45.0, 5.0, 15.0, 30.0, lastKnowPositionTs)); surfaceDriftData.add(new SARWeatherData(35.0, 8.0, 10.0, 20.0, lastKnowPositionTs.plusMinutes(30))); data.setWeatherPoints(surfaceDriftData); operation.startRapidResponseCalculations(data); assertEquals("61 04.854N", data.getDatum().getLatitudeAsString()); assertEquals("050 51.794W", data.getDatum().getLongitudeAsString()); assertEquals(35.37281521097134, data.getRdvDirection(), 0.0); assertEquals(3.9141344796902713, data.getRdvDistance(), 0.0); assertEquals(7.828268959380543, data.getRdvSpeed(), 0.0); assertEquals(1.3742403439070814, data.getRadius(), 0.0); assertEquals("61 06.769N", data.getA().getLatitudeAsString()); assertEquals("050 52.467W", data.getA().getLongitudeAsString()); assertEquals("61 05.179N", data.getB().getLatitudeAsString()); assertEquals("050 47.833W", data.getB().getLongitudeAsString()); assertEquals("61 02.939N", data.getC().getLatitudeAsString()); assertEquals("050 51.124W", data.getC().getLongitudeAsString()); assertEquals("61 04.529N", data.getD().getLatitudeAsString()); assertEquals("050 55.753W", data.getD().getLongitudeAsString()); }
public RapidResponseData startRapidResponseCalculations(RapidResponseData data) { double difference = (double) (data.getCSSDate().getMillis() - data.getLKPDate().getMillis()) / 60 / 60 / 1000; data.setTimeElasped(difference); return rapidResponse(data); }
SAROperation { public RapidResponseData startRapidResponseCalculations(RapidResponseData data) { double difference = (double) (data.getCSSDate().getMillis() - data.getLKPDate().getMillis()) / 60 / 60 / 1000; data.setTimeElasped(difference); return rapidResponse(data); } }
SAROperation { public RapidResponseData startRapidResponseCalculations(RapidResponseData data) { double difference = (double) (data.getCSSDate().getMillis() - data.getLKPDate().getMillis()) / 60 / 60 / 1000; data.setTimeElasped(difference); return rapidResponse(data); } SAROperation(SAR_TYPE operationType); }
SAROperation { public RapidResponseData startRapidResponseCalculations(RapidResponseData data) { double difference = (double) (data.getCSSDate().getMillis() - data.getLKPDate().getMillis()) / 60 / 60 / 1000; data.setTimeElasped(difference); return rapidResponse(data); } SAROperation(SAR_TYPE operationType); DatumLineData startDatumLineCalculations(DatumLineData data); RapidResponseData startRapidResponseCalculations(RapidResponseData data); DatumPointData startDatumPointCalculations(DatumPointData data); List<SARData> sarFutureCalculations(SARData data); DatumPointData datumPoint(DatumPointData data); Position applyDriftToPoint(SARData data, Position point, double timeElapsed); static void findRapidResponseBox(Position datum, double radius, RapidResponseData data); SAR_TYPE getOperationType(); void calculateEffortAllocation(SARData data); }
SAROperation { public RapidResponseData startRapidResponseCalculations(RapidResponseData data) { double difference = (double) (data.getCSSDate().getMillis() - data.getLKPDate().getMillis()) / 60 / 60 / 1000; data.setTimeElasped(difference); return rapidResponse(data); } SAROperation(SAR_TYPE operationType); DatumLineData startDatumLineCalculations(DatumLineData data); RapidResponseData startRapidResponseCalculations(RapidResponseData data); DatumPointData startDatumPointCalculations(DatumPointData data); List<SARData> sarFutureCalculations(SARData data); DatumPointData datumPoint(DatumPointData data); Position applyDriftToPoint(SARData data, Position point, double timeElapsed); static void findRapidResponseBox(Position datum, double radius, RapidResponseData data); SAR_TYPE getOperationType(); void calculateEffortAllocation(SARData data);  }