Commit e10764d6 authored by Christina's avatar Christina
Browse files

removed wait test because it is not necessary

parent 6fce4136
Pipeline #610223 failed with stages
in 78 minutes and 5 seconds
......@@ -35,8 +35,8 @@ import java.util.PriorityQueue;
* For instance:
* <pre>
* ...
* if (mostImportantStimulus instanceof Wait) {
* osmBehaviorController.wait()
* if (mostImportantStimulus instanceof ChangeTarget) {
* osmBehaviorController.changeTarger()
* }
* ...
* </pre>
......@@ -89,8 +89,6 @@ public class OSMBehaviorController {
changeToTargetRepulsionStrategyAndIncreaseSpeed(pedestrian, topography);
} else if (selfCategory == SelfCategory.COMMON_FATE) {
changeTargetToSafeZone(pedestrian, topography);
} else if (selfCategory == SelfCategory.WAIT) {
wait(pedestrian, topography, timeStepInSec);
} else if (selfCategory == SelfCategory.CHANGE_TARGET) {
changeTarget(pedestrian, topography);
}
......@@ -175,29 +173,7 @@ public class OSMBehaviorController {
pedestrian.setVelocity(new Vector2D(0, 0));
}
public void wait(PedestrianOSM pedestrian, Topography topography, double timeStepInSec) {
double stepStartTime = pedestrian.getTimeOfNextStep();
double stepEndTime = stepStartTime + timeStepInSec;
/* TODO: Discuss with Bene how to create a "correct footstep to avoid an interpolation exception
and to get the psychology status logged.
System.out.println(String.format("Ped[%d]: startTime[%.2f], endTime[%.2f], time[%.2f]", pedestrian.getId(), stepStartTime, stepEndTime, pedestrian.getMostImportantStimulus().getTime()));
assert stepEndTime >= stepStartTime && stepEndTime >= 0.0 && stepStartTime >= 0.0 : stepEndTime + "<" + stepStartTime;
VPoint currentPosition = pedestrian.getPosition();
VPoint nextPosition = currentPosition;
pedestrian.getStrides().add(Pair.of(currentPosition.distance(nextPosition), stepStartTime));
// Force a "FootStep" so that output processor is able to write out current "PsychologyStatus".
FootStep currentFootstep = new FootStep(currentPosition, nextPosition, stepStartTime, stepEndTime);
pedestrian.getTrajectory().add(currentFootstep);
pedestrian.getFootstepHistory().add(currentFootstep);
*/
//pedestrian.setTimeOfNextStep(stepEndTime);
}
/**
* Maximize distance to the threat (a threat) and increase speed.
......
......@@ -368,19 +368,7 @@ public class OSMBehaviorControllerTest {
@Test
public void waitSetsTimeOfNextStepForEventDrivenUpdateScheme() {
createSameDirectionTopography();
double currentSimTimeInSec = 1.0;
double timeOfNextStep = 0.5;
pedestrian1.setTimeOfNextStep(timeOfNextStep);
assertEquals(timeOfNextStep, pedestrian1.getTimeOfNextStep(), ALLOWED_DOUBLE_TOLERANCE);
OSMBehaviorController controllerUnderTest = new OSMBehaviorController(topography);
controllerUnderTest.wait(pedestrian1, topography, currentSimTimeInSec);
double expectedTimeOfNextStep = currentSimTimeInSec + timeOfNextStep;
assertEquals(expectedTimeOfNextStep, pedestrian1.getTimeOfNextStep(), ALLOWED_DOUBLE_TOLERANCE);
// remove test, because wait is handled as a footstep with next position = current position
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment