Commit 3b871511 authored by Julian Zobel's avatar Julian Zobel
Browse files

Adaptions for social group movements

parent 91c0dfe2
......@@ -39,6 +39,7 @@ import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location;
import de.tudarmstadt.maki.simonstrator.api.component.vehicular.api.SimulationSetupExtractor;
import de.tudarmstadt.maki.simonstrator.api.util.XMLConfigurableConstructor;
// FIXME javaDoc
public class RSUMovementModel implements MovementModel {
private final List<SimLocationActuator> components;
......
......@@ -72,26 +72,13 @@ public class StreetMovement implements MovementModel, EventHandler {
private long timeBetweenMoveOperation = Simulator.SECOND_UNIT;
private Random rand;
private Random rand = Randoms.getRandom(StreetMovement.class);
private double latLeft; //Values from -90 to 90; always smaller than latRight
private double latRight; //Values from -90 to 90
private double lonLeft; //Values from -180 to 180; Always smaller than lonRight
private double lonRight; //Values from -180 to 180
public StreetMovement() {
this.worldDimensions = Binder.getComponentOrNull(Topology.class)
.getWorldDimensions();
this.rand = Randoms.getRandom(StreetMovement.class);
latLeft = GPSCalculation.getLatLower();
latRight = GPSCalculation.getLatUpper();
lonLeft = GPSCalculation.getLonLeft();
lonRight = GPSCalculation.getLonRight();
System.out.println("Scheduling first event for Init");
// scheduling initalization!
Event.scheduleImmediately(this, null, EVENT_INIT);
}
......
......@@ -29,7 +29,6 @@ import de.tud.kom.p2psim.api.topology.movement.SimLocationActuator;
import de.tud.kom.p2psim.impl.topology.movement.modularosm.SocialGroupMovementModel;
import de.tud.kom.p2psim.impl.topology.movement.modularosm.groups.MovementGroupContainer;
import de.tud.kom.p2psim.impl.topology.movement.modularosm.groups.SocialMovementGroup;
import de.tud.kom.p2psim.impl.topology.movement.modularosm.groups.groupforming.AbstractGroupForming;
import de.tud.kom.p2psim.impl.topology.util.PositionVector;
import de.tudarmstadt.maki.simonstrator.api.Randoms;
import de.tudarmstadt.maki.simonstrator.api.Time;
......
......@@ -171,7 +171,10 @@ public abstract class AbstractGroupForming implements IGroupFormingBehavior {
* @return
*/
protected int rndGroupSize() {
return rand.nextInt(maxGroupSize - minGroupSize) + minGroupSize;
if(maxGroupSize == minGroupSize)
return minGroupSize;
else
return rand.nextInt(maxGroupSize - minGroupSize) + minGroupSize;
}
protected abstract void triggerGroupFormation();
......
......@@ -122,7 +122,7 @@ public abstract class AbstractAttractionBasedAssignmentStrategy implements IAttr
}
// fast skip forward if the attraction point would not be considered due to its score
if (ap.getWeight() > score) {
if (score >= ap.getWeight()) {
continue;
}
......
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