Commit 73c491b3 authored by Stefan Schuhbaeck's avatar Stefan Schuhbaeck
Browse files

Add annotations for source generation

parent 6a3b6451
......@@ -6,6 +6,7 @@ import java.util.List;
import java.util.PriorityQueue;
import java.util.Random;
import org.vadere.annotation.factories.models.ModelClass;
import org.vadere.simulator.models.MainModel;
import org.vadere.simulator.models.Model;
import org.vadere.state.attributes.Attributes;
......@@ -17,6 +18,7 @@ import org.vadere.state.scenario.Target;
import org.vadere.state.scenario.Topography;
import org.vadere.util.geometry.shapes.VPoint;
@ModelClass(isMainModel = true)
public class BehaviouralHeuristicsModel implements MainModel {
/**
......
......@@ -4,6 +4,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Random;
import org.vadere.annotation.factories.models.ModelClass;
import org.vadere.simulator.models.MainModel;
import org.vadere.simulator.models.Model;
import org.vadere.state.attributes.Attributes;
......@@ -21,6 +22,7 @@ import org.vadere.util.geometry.shapes.VPoint;
*
*
*/
@ModelClass(isMainModel = true)
public class BiomechanicsModel implements MainModel {
private List<Model> models = new LinkedList<>();
......
package org.vadere.simulator.models.gnm;
import org.vadere.annotation.factories.models.ModelClass;
import org.vadere.simulator.models.Model;
import org.vadere.simulator.models.ode.IntegratorFactory;
import org.vadere.simulator.models.ode.ODEModel;
......@@ -29,6 +30,7 @@ import java.util.Map;
import java.util.Random;
import java.util.TreeMap;
@ModelClass(isMainModel = true)
public class GradientNavigationModel extends ODEModel<Pedestrian, AttributesAgent> implements PotentialFieldModel {
private AttributesGNM attributes;
private GradientProvider floorGradient;
......
......@@ -5,6 +5,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Random;
import org.vadere.annotation.factories.models.ModelClass;
import org.vadere.simulator.models.potential.fields.PotentialFieldObstacle;
import org.vadere.state.attributes.Attributes;
import org.vadere.state.attributes.models.AttributesPotentialGNM;
......@@ -23,6 +24,7 @@ import org.vadere.util.potential.gradients.GradientProvider;
* calculating the distance to that point.
*
*/
@ModelClass
public class PotentialFieldObstacleGNM implements GradientProvider, PotentialFieldObstacle {
private Collection<Obstacle> obstacles;
......
......@@ -4,6 +4,7 @@ import java.util.Collection;
import java.util.List;
import java.util.Random;
import org.vadere.annotation.factories.models.ModelClass;
import org.vadere.simulator.models.potential.fields.PotentialFieldAgent;
import org.vadere.state.attributes.Attributes;
import org.vadere.state.attributes.models.AttributesPotentialGNM;
......@@ -17,6 +18,7 @@ import org.vadere.util.geometry.shapes.VCircle;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.math.MathUtil;
@ModelClass
public class PotentialFieldPedestrianGNM implements PotentialFieldAgent {
private final AttributesPotentialGNM attributes;
......
......@@ -6,6 +6,7 @@ import java.util.Map;
import java.util.Random;
import java.util.TreeMap;
import org.vadere.annotation.factories.models.ModelClass;
import org.vadere.simulator.models.Model;
import org.vadere.simulator.models.potential.fields.IPotentialFieldTarget;
import org.vadere.state.attributes.Attributes;
......@@ -15,6 +16,7 @@ import org.vadere.state.scenario.Pedestrian;
import org.vadere.state.scenario.ScenarioElement;
import org.vadere.state.scenario.Topography;
@ModelClass
public class CentroidGroupModel implements GroupModel {
private GroupSizeDeterminator groupSizeDeterminator;
......
......@@ -4,6 +4,7 @@ import java.util.Collection;
import java.util.List;
import java.util.Random;
import org.vadere.annotation.factories.models.ModelClass;
import org.vadere.simulator.models.potential.fields.PotentialFieldAgent;
import org.vadere.state.attributes.Attributes;
import org.vadere.state.attributes.models.AttributesCGM;
......@@ -15,6 +16,7 @@ import org.vadere.util.geometry.Vector2D;
import org.vadere.util.geometry.shapes.VCircle;
import org.vadere.util.geometry.shapes.VPoint;
@ModelClass
public class CentroidGroupPotential implements PotentialFieldAgent {
private final AttributesCGM attributesCGM;
......
package org.vadere.simulator.models.osm;
import org.vadere.annotation.factories.models.ModelClass;
import org.vadere.simulator.models.MainModel;
import org.vadere.simulator.models.Model;
import org.vadere.simulator.models.SpeedAdjuster;
......@@ -44,6 +45,7 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
@ModelClass(isMainModel = true)
public class OptimalStepsModel implements MainModel, PotentialFieldModel {
/**
......
/**
* This class implements the optimal velocity model for car traffic
*
/*
This class implements the optimal velocity model for car traffic
*/
package org.vadere.simulator.models.ovm;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import org.vadere.annotation.factories.models.ModelClass;
import org.vadere.simulator.models.Model;
import org.vadere.simulator.models.ode.IntegratorFactory;
import org.vadere.simulator.models.ode.ODEModel;
......@@ -23,6 +18,12 @@ import org.vadere.state.scenario.Topography;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.parallel.ParallelWorkerUtil;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Random;
@ModelClass(isMainModel = true)
public class OptimalVelocityModel extends ODEModel<Car, AttributesCar> {
private int carIdCounter = 10000000; // TODO [priority=low] [task=refactoring] hack, think about another way of separating car IDs and pedestrian IDs.
......@@ -32,15 +33,14 @@ public class OptimalVelocityModel extends ODEModel<Car, AttributesCar> {
/**
* Constructor for OptimalVelocityModel used in the ModelCreator
*
*/
@Deprecated
public OptimalVelocityModel(Topography scenario,
OVMEquations ovmEquations,
AttributesOVM attributesOVM,
AttributesCar elementAttributes,
boolean pedestrianInteraction,
Random random) {
OVMEquations ovmEquations,
AttributesOVM attributesOVM,
AttributesCar elementAttributes,
boolean pedestrianInteraction,
Random random) {
super(Car.class, scenario,
IntegratorFactory.createFirstOrderIntegrator(attributesOVM.getAttributesODEIntegrator()),
......@@ -57,11 +57,12 @@ public class OptimalVelocityModel extends ODEModel<Car, AttributesCar> {
ovmEquations.setGradients(null, null, null, scenario);
}
public OptimalVelocityModel() { }
public OptimalVelocityModel() {
}
@Override
public void initialize(List<Attributes> modelAttributesList, Topography topography,
AttributesAgent attributesPedestrian, Random random) {
AttributesAgent attributesPedestrian, Random random) {
this.attributesOVM = Model.findAttributes(modelAttributesList, AttributesOVM.class);
AttributesCar elementAttributes = topography.getAttributesCar();// Model.findAttributes(modelAttributesList, AttributesCar.class);
......@@ -82,10 +83,10 @@ public class OptimalVelocityModel extends ODEModel<Car, AttributesCar> {
@Override
/**
* Creates a single car with given attributes
*
* @param store
/*
Creates a single car with given attributes
@param store
* @return single Car-Object
*/
public <T extends DynamicElement> Agent createElement(VPoint position, int id, Class<T> type) {
......
......@@ -4,6 +4,7 @@ import java.util.Collection;
import java.util.List;
import java.util.Random;
import org.vadere.annotation.factories.models.ModelClass;
import org.vadere.simulator.models.potential.fields.PotentialFieldAgent;
import org.vadere.state.attributes.Attributes;
import org.vadere.state.attributes.scenario.AttributesAgent;
......@@ -15,6 +16,7 @@ import org.vadere.util.geometry.Vector2D;
import org.vadere.util.geometry.shapes.VCircle;
import org.vadere.util.geometry.shapes.VPoint;
@ModelClass
public class PedestrianRepulsionPotentialCycle implements
PotentialFieldAgent {
......
......@@ -5,6 +5,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Random;
import org.vadere.annotation.factories.models.ModelClass;
import org.vadere.simulator.models.potential.fields.PotentialFieldObstacle;
import org.vadere.state.attributes.Attributes;
import org.vadere.state.attributes.models.AttributesPotentialCompact;
......@@ -16,6 +17,7 @@ import org.vadere.state.scenario.Topography;
import org.vadere.util.geometry.Vector2D;
import org.vadere.util.geometry.shapes.VPoint;
@ModelClass
public class PotentialFieldObstacleCompact implements PotentialFieldObstacle {
private final AttributesPotentialCompact attributes;
......
......@@ -5,6 +5,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Random;
import org.vadere.annotation.factories.models.ModelClass;
import org.vadere.simulator.models.potential.fields.PotentialFieldObstacle;
import org.vadere.state.attributes.Attributes;
import org.vadere.state.attributes.models.AttributesPotentialCompactSoftshell;
......@@ -16,6 +17,7 @@ import org.vadere.state.scenario.Topography;
import org.vadere.util.geometry.Vector2D;
import org.vadere.util.geometry.shapes.VPoint;
@ModelClass
public class PotentialFieldObstacleCompactSoftshell implements PotentialFieldObstacle {
......
......@@ -5,6 +5,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Random;
import org.vadere.annotation.factories.models.ModelClass;
import org.vadere.simulator.models.potential.fields.PotentialFieldObstacle;
import org.vadere.state.attributes.Attributes;
import org.vadere.state.attributes.models.AttributesPotentialOSM;
......@@ -16,6 +17,7 @@ import org.vadere.state.scenario.Topography;
import org.vadere.util.geometry.Vector2D;
import org.vadere.util.geometry.shapes.VPoint;
@ModelClass
public class PotentialFieldObstacleOSM implements PotentialFieldObstacle {
private final AttributesPotentialOSM attributes;
......
......@@ -3,6 +3,7 @@ package org.vadere.simulator.models.potential;
import java.util.List;
import java.util.Random;
import org.vadere.annotation.factories.models.ModelClass;
import org.vadere.simulator.models.potential.fields.PotentialFieldObstacle;
import org.vadere.state.attributes.Attributes;
import org.vadere.state.attributes.models.AttributesPotentialRingExperiment;
......@@ -23,6 +24,8 @@ import org.vadere.util.geometry.shapes.VPoint;
* \ \__/ /
* \____/
*/
@ModelClass
public class PotentialFieldObstacleRingExperiment implements PotentialFieldObstacle {
private final AttributesPotentialRingExperiment attributes;
......
......@@ -6,6 +6,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Random;
import org.vadere.annotation.factories.models.ModelClass;
import org.vadere.simulator.models.potential.fields.PotentialFieldAgent;
import org.vadere.state.attributes.Attributes;
import org.vadere.state.attributes.models.AttributesPotentialCompact;
......@@ -17,6 +18,7 @@ import org.vadere.util.geometry.Vector2D;
import org.vadere.util.geometry.shapes.VCircle;
import org.vadere.util.geometry.shapes.VPoint;
@ModelClass
public class PotentialFieldPedestrianCompact implements PotentialFieldAgent {
class DistanceComparator implements Comparator<Agent> {
......
......@@ -5,6 +5,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Random;
import org.vadere.annotation.factories.models.ModelClass;
import org.vadere.simulator.models.potential.fields.PotentialFieldAgent;
import org.vadere.state.attributes.Attributes;
import org.vadere.state.attributes.models.AttributesPotentialCompactSoftshell;
......@@ -16,6 +17,7 @@ import org.vadere.util.geometry.Vector2D;
import org.vadere.util.geometry.shapes.VCircle;
import org.vadere.util.geometry.shapes.VPoint;
@ModelClass
public class PotentialFieldPedestrianCompactSoftshell implements PotentialFieldAgent {
......
......@@ -4,6 +4,7 @@ import java.util.Collection;
import java.util.List;
import java.util.Random;
import org.vadere.annotation.factories.models.ModelClass;
import org.vadere.simulator.models.potential.fields.PotentialFieldAgent;
import org.vadere.state.attributes.Attributes;
import org.vadere.state.attributes.models.AttributesPotentialOSM;
......@@ -15,6 +16,7 @@ import org.vadere.util.geometry.Vector2D;
import org.vadere.util.geometry.shapes.VCircle;
import org.vadere.util.geometry.shapes.VPoint;
@ModelClass
public class PotentialFieldPedestrianOSM implements PotentialFieldAgent {
private final AttributesPotentialOSM attributes;
......
......@@ -4,6 +4,7 @@ import java.util.List;
import java.util.Map;
import java.util.Random;
import org.vadere.annotation.factories.models.ModelClass;
import org.vadere.state.attributes.Attributes;
import org.vadere.state.attributes.models.AttributesFloorField;
import org.vadere.state.attributes.scenario.AttributesAgent;
......@@ -21,6 +22,7 @@ import org.vadere.util.geometry.shapes.VShape;
*
* Not finiehsed!
*/
@ModelClass
public class PotentialFieldMultiTargetGrid<T extends Agent> extends AbstractPotentialFieldTarget {
private static double EPSILON_SIM_TIME = 1e-100;
......
......@@ -4,6 +4,7 @@ import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;
import org.vadere.annotation.factories.models.ModelClass;
import org.vadere.state.attributes.Attributes;
import org.vadere.state.attributes.models.AttributesFloorField;
import org.vadere.state.attributes.scenario.AttributesAgent;
......@@ -19,6 +20,7 @@ import org.vadere.util.geometry.shapes.VShape;
* based on the AttributesFloorField.
*
*/
@ModelClass
public class PotentialFieldSingleTargetGrid extends AbstractPotentialFieldTarget {
private Topography topography;
......
......@@ -2,6 +2,7 @@ package org.vadere.simulator.models.potential.fields;
import java.util.*;
import org.vadere.annotation.factories.models.ModelClass;
import org.vadere.state.attributes.Attributes;
import org.vadere.state.attributes.models.AttributesFloorField;
import org.vadere.state.attributes.scenario.AttributesAgent;
......@@ -15,6 +16,8 @@ import org.vadere.util.geometry.shapes.VShape;
* based on the AttributesFloorField.
*
*/
@ModelClass
public class PotentialFieldTargetGrid extends AbstractPotentialFieldTarget {
// private HashMap<Integer, PotentialFieldAndInitializer> staticPotentialFields;
......
Supports Markdown
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