Skip to content

Commit

Permalink
Changed order of logics to discard routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego committed Jan 20, 2024
1 parent b4b5e9f commit 3273334
Showing 1 changed file with 18 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ public List<IObjectArtifact> instantiate(IObservable semantics, IContextualizati
Set<IObservation> connected = new HashSet<>();

int nullTrajectories = 0;
int outOfLimitTrajectories = 0;

for (IObservation source : allSources) {

Expand Down Expand Up @@ -283,25 +284,29 @@ public List<IObjectArtifact> instantiate(IObservable semantics, IContextualizati
trajectory = null;
}


if (
(timeThreshold == null || ((Double) stats.get("time") < timeThreshold)) &&
(distanceThreshold == null || ((Double) stats.get("length") < distanceThreshold))

)
{
if (trajectory != null && stats != null) {

if (
(timeThreshold == null || ((Double) stats.get("time") < timeThreshold)) &&
(distanceThreshold == null || ((Double) stats.get("length") < distanceThreshold))

)
{

if (trajectory != null) {
connect((IDirectObservation) source, (IDirectObservation) target, trajectory, routeParameters);
connected.add((IObservation) target);
trajectories.put(new Pair<IDirectObservation,IDirectObservation>((IDirectObservation)source,(IDirectObservation)target),trajectory);
}
else {

nullTrajectories += 1;

}
else {
outOfLimitTrajectories += 1;
}

}
else {

nullTrajectories += 1;

}

}
}
Expand Down

0 comments on commit 3273334

Please sign in to comment.