Commit dc857437 authored by Julian Zobel's avatar Julian Zobel
Browse files

More refactoring for social group movement

parent 30bbfedd
...@@ -20,39 +20,25 @@ ...@@ -20,39 +20,25 @@
package de.tud.kom.p2psim.impl.topology.movement.modularosm; package de.tud.kom.p2psim.impl.topology.movement.modularosm;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet; import java.util.LinkedHashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Random;
import java.util.Set; import java.util.Set;
import java.util.Vector; import java.util.Vector;
import de.tud.kom.p2psim.api.scenario.ConfigurationException; import de.tud.kom.p2psim.api.scenario.ConfigurationException;
import de.tud.kom.p2psim.api.topology.Topology;
import de.tud.kom.p2psim.api.topology.movement.MovementModel;
import de.tud.kom.p2psim.api.topology.movement.SimLocationActuator; import de.tud.kom.p2psim.api.topology.movement.SimLocationActuator;
import de.tud.kom.p2psim.api.topology.movement.local.LocalMovementStrategy; import de.tud.kom.p2psim.api.topology.movement.local.LocalMovementStrategy;
import de.tud.kom.p2psim.api.topology.placement.PlacementModel;
import de.tud.kom.p2psim.impl.simengine.Simulator;
import de.tud.kom.p2psim.impl.topology.TopologyFactory;
import de.tud.kom.p2psim.impl.topology.movement.modularosm.attraction.IAttractionGenerator; import de.tud.kom.p2psim.impl.topology.movement.modularosm.attraction.IAttractionGenerator;
import de.tud.kom.p2psim.impl.topology.movement.modularosm.attraction.hostcount.IAttractionPointHostCounter; import de.tud.kom.p2psim.impl.topology.movement.modularosm.attraction.hostcount.IAttractionPointHostCounter;
import de.tud.kom.p2psim.impl.topology.movement.modularosm.groups.MovementGroupContainer; 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.SocialMovementGroup;
import de.tud.kom.p2psim.impl.topology.movement.modularosm.groups.groupencounter.IGroupEncounterBehavior; import de.tud.kom.p2psim.impl.topology.movement.modularosm.groups.groupencounter.IGroupEncounterBehavior;
import de.tud.kom.p2psim.impl.topology.movement.modularosm.groups.groupforming.IGroupFormingBehavior; import de.tud.kom.p2psim.impl.topology.movement.modularosm.groups.groupforming.IGroupFormingBehavior;
import de.tud.kom.p2psim.impl.topology.movement.modularosm.mapvisualization.IMapVisualization;
import de.tud.kom.p2psim.impl.topology.movement.modularosm.transition.IAttractionAssigmentStrategy; import de.tud.kom.p2psim.impl.topology.movement.modularosm.transition.IAttractionAssigmentStrategy;
import de.tud.kom.p2psim.impl.topology.movement.modularosm.transition.IAttractionAssigmentStrategy.AttractionAssignmentListener;
import de.tud.kom.p2psim.impl.topology.util.PositionVector; import de.tud.kom.p2psim.impl.topology.util.PositionVector;
import de.tud.kom.p2psim.impl.topology.views.VisualizationTopologyView.VisualizationInjector;
import de.tud.kom.p2psim.impl.util.Either;
import de.tudarmstadt.maki.simonstrator.api.Binder;
import de.tudarmstadt.maki.simonstrator.api.Event; import de.tudarmstadt.maki.simonstrator.api.Event;
import de.tudarmstadt.maki.simonstrator.api.EventHandler;
import de.tudarmstadt.maki.simonstrator.api.Randoms;
import de.tudarmstadt.maki.simonstrator.api.Time;
import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.AttractionPoint; import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.AttractionPoint;
/** /**
...@@ -94,8 +80,6 @@ public class SocialGroupMovementModel extends ModularMovementModel { ...@@ -94,8 +80,6 @@ public class SocialGroupMovementModel extends ModularMovementModel {
* Returns a random SimLocationActuator component from the set of moveable hosts. * Returns a random SimLocationActuator component from the set of moveable hosts.
* *
* @return SimLocationActuator * @return SimLocationActuator
*
* @author Marcel Verst
*/ */
private SimLocationActuator getRandomActuator() { private SimLocationActuator getRandomActuator() {
...@@ -117,8 +101,6 @@ public class SocialGroupMovementModel extends ModularMovementModel { ...@@ -117,8 +101,6 @@ public class SocialGroupMovementModel extends ModularMovementModel {
* 2) Creates and deletes groups, if necessary. * 2) Creates and deletes groups, if necessary.
* 3) Applies encounter action to meeting groups. * 3) Applies encounter action to meeting groups.
* 4) Moves the hosts using doGroupMovement, movement style depends on role of the host (Leader, Participant, Single) * 4) Moves the hosts using doGroupMovement, movement style depends on role of the host (Leader, Participant, Single)
*
* @author Marcel Verst
*/ */
@Override @Override
protected void move() { protected void move() {
...@@ -133,7 +115,7 @@ public class SocialGroupMovementModel extends ModularMovementModel { ...@@ -133,7 +115,7 @@ public class SocialGroupMovementModel extends ModularMovementModel {
Set<SocialMovementGroup[]> encounteringGroups = groupEncounterBehavior.getEncounteringGroups(); Set<SocialMovementGroup[]> encounteringGroups = groupEncounterBehavior.getEncounteringGroups();
groupEncounterBehavior.handleEncounters(encounteringGroups); groupEncounterBehavior.handleEncounters(encounteringGroups);
/** /*
* Moves all nodes according to definition in group movement method * Moves all nodes according to definition in group movement method
*/ */
for (SimLocationActuator component : moveableHosts) { for (SimLocationActuator component : moveableHosts) {
...@@ -152,8 +134,6 @@ public class SocialGroupMovementModel extends ModularMovementModel { ...@@ -152,8 +134,6 @@ public class SocialGroupMovementModel extends ModularMovementModel {
* *
* @param SimLocationActuator The host to move. * @param SimLocationActuator The host to move.
* @param PositionVector Destination of the host. * @param PositionVector Destination of the host.
*
* @author Marcel Verst
*/ */
protected void doGroupMovement(SimLocationActuator host, PositionVector destination) { protected void doGroupMovement(SimLocationActuator host, PositionVector destination) {
// Single Host Movement // Single Host Movement
...@@ -163,8 +143,8 @@ public class SocialGroupMovementModel extends ModularMovementModel { ...@@ -163,8 +143,8 @@ public class SocialGroupMovementModel extends ModularMovementModel {
// Group Related Movement // Group Related Movement
else if(groupContainer.isGroupMember(host)){ else if(groupContainer.isGroupMember(host)){
if(movesToMP(host)) { if(movesToGroupMeetingPoint(host)) {
if(atMP(host)) { if(hostIsAtMeetingPoint(host)) {
if(groupAtMP(host)) { if(groupAtMP(host)) {
SocialMovementGroup group = groupContainer.getGroupOfHost(host); SocialMovementGroup group = groupContainer.getGroupOfHost(host);
AttractionPoint currAp = group.getLeader().getCurrentTargetAttractionPoint(); AttractionPoint currAp = group.getLeader().getCurrentTargetAttractionPoint();
...@@ -207,10 +187,8 @@ public class SocialGroupMovementModel extends ModularMovementModel { ...@@ -207,10 +187,8 @@ public class SocialGroupMovementModel extends ModularMovementModel {
* *
* @param SimLocationActuator The host to be checked. * @param SimLocationActuator The host to be checked.
* @return Boolean * @return Boolean
*
* @author Marcel Verst
*/ */
private boolean movesToMP(SimLocationActuator host) { private boolean movesToGroupMeetingPoint(SimLocationActuator host) {
PositionVector mp = groupContainer.getGroupOfHost(host).getMeetingPoint(); PositionVector mp = groupContainer.getGroupOfHost(host).getMeetingPoint();
PositionVector dest = groupContainer.getGroupOfHost(host).getDestination(); PositionVector dest = groupContainer.getGroupOfHost(host).getDestination();
if(mp != dest) { if(mp != dest) {
...@@ -224,14 +202,12 @@ public class SocialGroupMovementModel extends ModularMovementModel { ...@@ -224,14 +202,12 @@ public class SocialGroupMovementModel extends ModularMovementModel {
* *
* @param SimLocationActuator The host to be checked. * @param SimLocationActuator The host to be checked.
* @return Boolean * @return Boolean
*
* @author Marcel Verst
*/ */
private boolean groupAtMP(SimLocationActuator host) { private boolean groupAtMP(SimLocationActuator host) {
Set<SimLocationActuator> participants = groupContainer.getGroupMembers(host); Set<SimLocationActuator> participants = groupContainer.getGroupMembers(host);
int counter = 0; int counter = 0;
for(SimLocationActuator participant : participants) { for(SimLocationActuator participant : participants) {
if(atMP(participant)) { if(hostIsAtMeetingPoint(participant)) {
counter++; counter++;
} }
} }
...@@ -247,16 +223,15 @@ public class SocialGroupMovementModel extends ModularMovementModel { ...@@ -247,16 +223,15 @@ public class SocialGroupMovementModel extends ModularMovementModel {
* @param SimLocationActuator The host to be checked. * @param SimLocationActuator The host to be checked.
* @return Boolean * @return Boolean
* *
* @author Marcel Verst
*/ */
private boolean atMP(SimLocationActuator host) { private boolean hostIsAtMeetingPoint(SimLocationActuator host) {
PositionVector currMP = groupContainer.getGroupOfHost(host).getMeetingPoint(); PositionVector currMP = groupContainer.getGroupOfHost(host).getMeetingPoint();
// Setting the required distance to the meeting point to maximum of 2 meters // Setting the required distance to the meeting point to maximum of 2 meters
// This is equivalent to a distance of group members in real life // This is equivalent to a distance of group members in real life
double distance = host.getLastLocation().distanceTo(currMP); double distance = host.getLastLocation().distanceTo(currMP);
if(distance <= 2) { if(distance <= 5) {
return true; return true;
} }
return false; return false;
...@@ -273,8 +248,6 @@ public class SocialGroupMovementModel extends ModularMovementModel { ...@@ -273,8 +248,6 @@ public class SocialGroupMovementModel extends ModularMovementModel {
* Host position adapts to leaders position by taking the leader position and adding a small offset * Host position adapts to leaders position by taking the leader position and adding a small offset
* *
* @param SimLocationActuator The host to be moved. * @param SimLocationActuator The host to be moved.
*
* @author Marcel Verst
*/ */
private void followLeader(SimLocationActuator host) { private void followLeader(SimLocationActuator host) {
SimLocationActuator leader = groupContainer.getGroupOfHost(host).getLeader(); SimLocationActuator leader = groupContainer.getGroupOfHost(host).getLeader();
...@@ -357,6 +330,10 @@ public class SocialGroupMovementModel extends ModularMovementModel { ...@@ -357,6 +330,10 @@ public class SocialGroupMovementModel extends ModularMovementModel {
return singleHosts; return singleHosts;
} }
public Map<SimLocationActuator, PositionVector> getCurrentTargets(){
return currentTargets;
}
/** /**
* Only for visualization! * Only for visualization!
* *
...@@ -366,8 +343,6 @@ public class SocialGroupMovementModel extends ModularMovementModel { ...@@ -366,8 +343,6 @@ public class SocialGroupMovementModel extends ModularMovementModel {
return new Vector<AttractionPoint>(IAttractionGenerator.attractionPoints); return new Vector<AttractionPoint>(IAttractionGenerator.attractionPoints);
} }
public Map<SimLocationActuator, PositionVector> getCurrentTargets(){
return currentTargets;
}
} }
...@@ -34,7 +34,6 @@ import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Attraction ...@@ -34,7 +34,6 @@ import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Attraction
*/ */
public interface IAttractionGenerator { public interface IAttractionGenerator {
// TODO make this private in JAVA >= 9
static LinkedList<AttractionPoint> attractionPoints = new LinkedList<>(); static LinkedList<AttractionPoint> attractionPoints = new LinkedList<>();
public List<AttractionPoint> getAttractionPoints(); public List<AttractionPoint> getAttractionPoints();
......
...@@ -33,7 +33,6 @@ import de.tud.kom.p2psim.impl.topology.movement.modularosm.attraction.IAttractio ...@@ -33,7 +33,6 @@ import de.tud.kom.p2psim.impl.topology.movement.modularosm.attraction.IAttractio
import de.tud.kom.p2psim.impl.topology.movement.modularosm.attraction.hostcount.IAttractionPointHostCounter; import de.tud.kom.p2psim.impl.topology.movement.modularosm.attraction.hostcount.IAttractionPointHostCounter;
import de.tud.kom.p2psim.impl.topology.movement.modularosm.groups.SocialMovementGroup; import de.tud.kom.p2psim.impl.topology.movement.modularosm.groups.SocialMovementGroup;
import de.tud.kom.p2psim.impl.topology.movement.modularosm.groups.MovementGroupContainer; import de.tud.kom.p2psim.impl.topology.movement.modularosm.groups.MovementGroupContainer;
import de.tud.kom.p2psim.impl.topology.movement.modularosm.transition.IAttractionAssigmentStrategy;
import de.tud.kom.p2psim.impl.topology.util.PositionVector; import de.tud.kom.p2psim.impl.topology.util.PositionVector;
import de.tud.kom.p2psim.impl.util.Tuple; import de.tud.kom.p2psim.impl.util.Tuple;
import de.tudarmstadt.maki.simonstrator.api.Event; import de.tudarmstadt.maki.simonstrator.api.Event;
...@@ -47,8 +46,8 @@ import de.tudarmstadt.maki.simonstrator.api.util.XMLConfigurableConstructor; ...@@ -47,8 +46,8 @@ import de.tudarmstadt.maki.simonstrator.api.util.XMLConfigurableConstructor;
/** /**
* Abstract class implementation for implementing GroupFormingStrategies. * Abstract class implementation for implementing GroupFormingStrategies.
* *
* @author Marcel Verst * @author Marcel Verst, Julian Zobel
* @version 1.0, 22.11.2018 * @version 1.1, 30.01.2020
*/ */
public abstract class AbstractGroupForming implements IGroupFormingBehavior { public abstract class AbstractGroupForming implements IGroupFormingBehavior {
protected Random rand = Randoms.getRandom(AbstractGroupForming.class); protected Random rand = Randoms.getRandom(AbstractGroupForming.class);
...@@ -68,7 +67,7 @@ public abstract class AbstractGroupForming implements IGroupFormingBehavior { ...@@ -68,7 +67,7 @@ public abstract class AbstractGroupForming implements IGroupFormingBehavior {
protected long groupRejoinWaitTime; protected long groupRejoinWaitTime;
protected long groupFormationSetupDelay; protected long groupFormationSetupDelay;
protected long groupFormationDelay; private long groupFormationDelay;
protected IAttractionPointHostCounter hostCounter; protected IAttractionPointHostCounter hostCounter;
...@@ -146,37 +145,65 @@ public abstract class AbstractGroupForming implements IGroupFormingBehavior { ...@@ -146,37 +145,65 @@ public abstract class AbstractGroupForming implements IGroupFormingBehavior {
}, null, 0); }, null, 0);
} }
protected abstract void triggerGroupFormation(); /**
* Returns a time delay between removal and creation of a group. A random part of up to half of the
* stated formation delay is added to/substracted from the formation delay.
*
* @return
*/
protected long rndGroupFormationDelay() {
return (long) ((rand.nextDouble() + 0.5) * groupFormationDelay);
}
/**
* Returns a random integer value between the minimum and maximumn group size boundaries
* with an additional upper boundary.
*
* @return
*/
protected int rndGroupSize(int max) {
return Math.min(rndGroupSize(), max);
}
/** /**
* Creates a group with the given set of participants. * Returns a random integer value between the minimum and maximumn group size boundaries.
* *
* @param Set<SimLocationActuator> The participants which want to form a group. * @return
*/
protected int rndGroupSize() {
return rand.nextInt(maxGroupSize - minGroupSize) + minGroupSize;
}
protected abstract void triggerGroupFormation();
/**
* Creates a group with the given set of members.
* *
* @author Marcel Verst * @param Set<SimLocationActuator> The members which want to form a group.
*/ */
protected void createGroup(Set<SimLocationActuator> candidates) { protected void createGroup(Set<SimLocationActuator> members) {
SocialMovementGroup group = new SocialMovementGroup(candidates); SocialMovementGroup group = new SocialMovementGroup(members);
// Guarantee that the new destination of a group is not equal to the current AttractionPoint where the group is created // Guarantee that the new destination of a group is not equal to the current AttractionPoint where the group is created
// This would be the case if the destination of the group leader is the current position of the group. // This would be the case if the destination of the group leader is the current position of the group.
AttractionPoint leaderTarget = group.getLeader().getCurrentTargetAttractionPoint(); AttractionPoint leaderTarget = group.getLeader().getCurrentTargetAttractionPoint();
AttractionPoint poiDestination = null; AttractionPoint nextDestination = null;
do { do {
poiDestination = getRandomAttractionPoint(); nextDestination = getRandomAttractionPoint();
} while(poiDestination == leaderTarget); } while(nextDestination == leaderTarget);
// Add Offset to destination // Add Offset to destination
PositionVector destination = new PositionVector(poiDestination.getLongitudeOrX(), poiDestination.getLatitudeOrY()); PositionVector destination = new PositionVector(nextDestination);
double apRadius = poiDestination.getRadius(); double apRadius = nextDestination.getRadius();
PositionVector offset = new PositionVector(rand.nextDouble() * apRadius / 3, rand.nextDouble() * apRadius / 3); PositionVector offset = new PositionVector(rand.nextGaussian() * apRadius / 3, rand.nextGaussian() * apRadius / 3);
destination.plus(offset); destination.plus(offset);
group.setDestination(destination); group.setDestination(destination);
setGroupMeetingPoint(group); setGroupMeetingPoint(group);
for(SimLocationActuator member : group.getMembers()) { for(SimLocationActuator member : group.getMembers()) {
member.setTargetAttractionPoint(poiDestination); member.setTargetAttractionPoint(nextDestination);
if(groupCon.hostWasGroupMember(member)) { if(groupCon.hostWasGroupMember(member)) {
groupCon.removeLeftGroupAtTimeEntry(member); groupCon.removeLeftGroupAtTimeEntry(member);
} }
...@@ -376,8 +403,7 @@ public abstract class AbstractGroupForming implements IGroupFormingBehavior { ...@@ -376,8 +403,7 @@ public abstract class AbstractGroupForming implements IGroupFormingBehavior {
// Update target for all group members to meeting point // Update target for all group members to meeting point
for(SimLocationActuator participant : group.getMembers()) { for(SimLocationActuator participant : group.getMembers()) {
IAttractionAssigmentStrategy transition = movementModel.getAttractionAssignmentStrategy(); movementModel.getAttractionAssignmentStrategy().updateTargetAttractionPoint(participant, meetingPoint);
transition.updateTargetAttractionPoint(participant, meetingPoint);
} }
} }
......
...@@ -20,17 +20,12 @@ ...@@ -20,17 +20,12 @@
package de.tud.kom.p2psim.impl.topology.movement.modularosm.groups.groupforming; package de.tud.kom.p2psim.impl.topology.movement.modularosm.groups.groupforming;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet; import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set; import java.util.Set;
import de.tud.kom.p2psim.api.scenario.ConfigurationException;
import de.tud.kom.p2psim.api.topology.movement.SimLocationActuator; import de.tud.kom.p2psim.api.topology.movement.SimLocationActuator;
import de.tud.kom.p2psim.api.topology.movement.local.LocalMovementStrategy; import de.tud.kom.p2psim.api.topology.movement.local.LocalMovementStrategy;
import de.tud.kom.p2psim.impl.topology.movement.modularosm.SocialGroupMovementModel;
import de.tud.kom.p2psim.impl.topology.movement.modularosm.attraction.IAttractionGenerator; import de.tud.kom.p2psim.impl.topology.movement.modularosm.attraction.IAttractionGenerator;
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.SocialMovementGroup;
import de.tud.kom.p2psim.impl.topology.movement.modularosm.transition.IAttractionAssigmentStrategy; import de.tud.kom.p2psim.impl.topology.movement.modularosm.transition.IAttractionAssigmentStrategy;
import de.tud.kom.p2psim.impl.topology.util.PositionVector; import de.tud.kom.p2psim.impl.topology.util.PositionVector;
...@@ -107,11 +102,8 @@ public class DefaultGroupForming extends AbstractGroupForming { ...@@ -107,11 +102,8 @@ public class DefaultGroupForming extends AbstractGroupForming {
} }
int numberOfHostsInAttractionPoint = hostCounter.getHostCountOfAttractionPoint(apCandidate); int numberOfHostsInAttractionPoint = hostCounter.getHostCountOfAttractionPoint(apCandidate);
int groupSize = Math.min(Math.max(minGroupSize, rand.nextInt(maxGroupSize)), numberOfHostsInAttractionPoint); int groupSize = this.rndGroupSize(numberOfHostsInAttractionPoint);
if(groupSize > numberOfHostsInAttractionPoint) {
throw new UnsupportedOperationException("Math Genius you are not!");
}
Set<SimLocationActuator> groupCandidates = new LinkedHashSet<>(); Set<SimLocationActuator> groupCandidates = new LinkedHashSet<>();
...@@ -199,9 +191,9 @@ public class DefaultGroupForming extends AbstractGroupForming { ...@@ -199,9 +191,9 @@ public class DefaultGroupForming extends AbstractGroupForming {
for(SocialMovementGroup group : groupsToRemove) { for(SocialMovementGroup group : groupsToRemove) {
removeGroup(group); removeGroup(group);
System.out.println("Removed group, schedule new formation in " + Time.getFormattedTime(groupFormationDelay) + " @ " + Time.getFormattedTime(Time.getCurrentTime() + groupFormationDelay)); //System.out.println("Removed group, schedule new formation in " + Time.getFormattedTime(groupFormationDelay) + " @ " + Time.getFormattedTime(Time.getCurrentTime() + groupFormationDelay));
Event.scheduleWithDelay(groupFormationDelay, new EventHandler() { Event.scheduleWithDelay(rndGroupFormationDelay(), new EventHandler() {
@Override @Override
public void eventOccurred(Object content, int type) { public void eventOccurred(Object content, int type) {
triggerGroupFormation(); triggerGroupFormation();
......
...@@ -37,9 +37,9 @@ import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Attraction ...@@ -37,9 +37,9 @@ import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Attraction
* @author Julian Zobel * @author Julian Zobel
* @version 1.0, 23.01.2019 * @version 1.0, 23.01.2019
*/ */
public abstract class AbstractAttractionBasedTransitionStrategy implements IAttractionAssigmentStrategy { public abstract class AbstractAttractionBasedAssignmentStrategy implements IAttractionAssigmentStrategy {
protected Random rnd = Randoms.getRandom(AbstractAttractionBasedTransitionStrategy.class); protected Random rnd = Randoms.getRandom(AbstractAttractionBasedAssignmentStrategy.class);
protected Map<SimLocationActuator, AttractionPoint> assignments = new LinkedHashMap<>(); protected Map<SimLocationActuator, AttractionPoint> assignments = new LinkedHashMap<>();
......
...@@ -38,7 +38,7 @@ import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Attraction ...@@ -38,7 +38,7 @@ import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Attraction
* @author Martin Hellwig * @author Martin Hellwig
* @version 1.0, 07.07.2015 * @version 1.0, 07.07.2015
*/ */
public class FixedAssignmentStrategy extends AbstractAttractionBasedTransitionStrategy { public class FixedAssignmentStrategy extends AbstractAttractionBasedAssignmentStrategy {
private List<SimLocationActuator> comps = new LinkedList<SimLocationActuator>(); private List<SimLocationActuator> comps = new LinkedList<SimLocationActuator>();
......
...@@ -38,7 +38,7 @@ import de.tudarmstadt.maki.simonstrator.api.util.XMLConfigurableConstructor; ...@@ -38,7 +38,7 @@ import de.tudarmstadt.maki.simonstrator.api.util.XMLConfigurableConstructor;
* @author Julian Zobel * @author Julian Zobel
* @version 1.0, 24.01.2019 * @version 1.0, 24.01.2019
*/ */
public class InAreaRoamingTransitionStrategy extends AbstractAttractionBasedTransitionStrategy implements EventHandler { public class InAreaRoamingTransitionStrategy extends AbstractAttractionBasedAssignmentStrategy implements EventHandler {
public static enum roamingTransitionState { public static enum roamingTransitionState {
PAUSE, PAUSE,
......
...@@ -19,13 +19,13 @@ import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location; ...@@ -19,13 +19,13 @@ import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location;
* *
* @author Clemens Krug * @author Clemens Krug
* *
* Made the transition strategy extend the {@link AbstractAttractionBasedTransitionStrategy} for a more generalized approach on * Made the transition strategy extend the {@link AbstractAttractionBasedAssignmentStrategy} for a more generalized approach on
* the {@link IAttractionAssigmentStrategy} implementation for attraction point based strategies. * the {@link IAttractionAssigmentStrategy} implementation for attraction point based strategies.
* *
* @author Julian Zobel * @author Julian Zobel
* @version 1.1, January 2019 * @version 1.1, January 2019
*/ */
public class RandomInAreaTransitionStrategy extends AbstractAttractionBasedTransitionStrategy public class RandomInAreaTransitionStrategy extends AbstractAttractionBasedAssignmentStrategy
{ {
/** /**
* These are the current spots inside the target area where the client is currently heading. * These are the current spots inside the target area where the client is currently heading.
......
...@@ -78,7 +78,7 @@ import de.tudarmstadt.maki.simonstrator.api.util.XMLConfigurableConstructor; ...@@ -78,7 +78,7 @@ import de.tudarmstadt.maki.simonstrator.api.util.XMLConfigurableConstructor;
* *
* *
*/ */
public class SocialTransitionStrategy extends AbstractAttractionBasedTransitionStrategy implements EventHandler { public class SocialTransitionStrategy extends AbstractAttractionBasedAssignmentStrategy implements EventHandler {
private String socialId = null; private String socialId = null;
......
...@@ -32,14 +32,14 @@ import de.tudarmstadt.maki.simonstrator.api.util.XMLConfigurableConstructor; ...@@ -32,14 +32,14 @@ import de.tudarmstadt.maki.simonstrator.api.util.XMLConfigurableConstructor;
* @author Bjoern Richerzhagen * @author Bjoern Richerzhagen
* @version 1.0, Jan 16, 2017 * @version 1.0, Jan 16, 2017
* *
* Made the transition strategy extend the {@link AbstractAttractionBasedTransitionStrategy} for a more generalized approach on * Made the transition strategy extend the {@link AbstractAttractionBasedAssignmentStrategy} for a more generalized approach on
* the {@link IAttractionAssigmentStrategy} implementation for attraction point based strategies. * the {@link IAttractionAssigmentStrategy} implementation for attraction point based strategies.
* *
* @author Julian Zobel * @author Julian Zobel
* @version 1.1, January 2019 * @version 1.1, January 2019
* *
*/ */
public class WeightedTransitionStrategy extends AbstractAttractionBasedTransitionStrategy implements EventHandler { public class WeightedTransitionStrategy extends AbstractAttractionBasedAssignmentStrategy implements EventHandler {
@XMLConfigurableConstructor({ "defaultPauseTimeMin", "defaultPauseTimeMax" }) @XMLConfigurableConstructor({ "defaultPauseTimeMin", "defaultPauseTimeMax" })
public WeightedTransitionStrategy(long defaultPauseTimeMin, long defaultPauseTimeMax) { public WeightedTransitionStrategy(long defaultPauseTimeMin, long defaultPauseTimeMax) {
......
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