Commit 76b8e099 authored by Stefan Schuhbaeck's avatar Stefan Schuhbaeck
Browse files

add compiletime annotations to processors and outputfiles

parent b251269c
package org.vadere.simulator.projects.dataprocessing.outputfile;
import org.vadere.annotation.factories.OutputFileClass;
import org.vadere.simulator.projects.dataprocessing.datakey.IdDataKey;
@OutputFileClass()
public class IdOutputFile extends OutputFile<IdDataKey> {
public IdOutputFile() {
......
package org.vadere.simulator.projects.dataprocessing.outputfile;
import org.vadere.annotation.factories.OutputFileClass;
import org.vadere.simulator.projects.dataprocessing.datakey.NoDataKey;
/**
* @author Mario Teixeira Parente
*
*/
@OutputFileClass()
public class NoDataKeyOutputFile extends OutputFile<NoDataKey> {
public NoDataKeyOutputFile() {
super(new String[] { });
......
package org.vadere.simulator.projects.dataprocessing.outputfile;
import org.vadere.simulator.projects.dataprocessing.datakey.DataKey;
import org.vadere.simulator.projects.dataprocessing.datakey.OutputFileMap;
import org.vadere.simulator.projects.dataprocessing.store.OutputFileStore;
import org.vadere.util.reflection.DynamicClassInstantiator;
import org.vadere.util.reflection.VadereNoOutputfileForDataKeyException;
......@@ -55,31 +56,7 @@ public class OutputFileFactory {
public OutputFile<?> createDefaultOutputfileByDataKey(Class<? extends DataKey<?>> keyType) {
String simpleName = keyType.getSimpleName();
if (simpleName.equals("IdDataKey"))
return createOutputfile(IdOutputFile.class);
if (simpleName.equals("NoDataKey"))
return createOutputfile(NoDataKeyOutputFile.class);
if (simpleName.equals("PedestrianIdKey"))
return createOutputfile(PedestrianIdOutputFile.class);
if (simpleName.equals("TimestepKey"))
return createOutputfile(TimestepOutputFile.class);
if (simpleName.equals("TimestepPedestrianIdKey"))
return createOutputfile(TimestepPedestrianIdOutputFile.class);
if (simpleName.equals("TimestepPositionKey"))
return createOutputfile(TimestepPositionOutputFile.class);
if (simpleName.equals("TimestepRowKey"))
return createOutputfile(TimestepRowOutputFile.class);
throw new VadereNoOutputfileForDataKeyException(
"No Ouputfile defined for DataKey: " + keyType.getCanonicalName());
OutputFileMap outputFileMap = keyType.getAnnotation(OutputFileMap.class);
return createOutputfile(outputFileMap.outputFileClass());
}
}
package org.vadere.simulator.projects.dataprocessing.outputfile;
import org.vadere.annotation.factories.OutputFileClass;
import org.vadere.simulator.projects.dataprocessing.datakey.PedestrianIdKey;
/**
* @author Mario Teixeira Parente
*
*/
@OutputFileClass()
public class PedestrianIdOutputFile extends OutputFile<PedestrianIdKey> {
public PedestrianIdOutputFile() {
......
package org.vadere.simulator.projects.dataprocessing.outputfile;
import org.vadere.annotation.factories.OutputFileClass;
import org.vadere.simulator.projects.dataprocessing.datakey.TimestepKey;
/**
* @author Mario Teixeira Parente
*
*/
@OutputFileClass()
public class TimestepOutputFile extends OutputFile<TimestepKey> {
public TimestepOutputFile() {
......
package org.vadere.simulator.projects.dataprocessing.outputfile;
import org.vadere.annotation.factories.OutputFileClass;
import org.vadere.simulator.projects.dataprocessing.datakey.TimestepPedestrianIdKey;
/**
* @author Mario Teixeira Parente
*
*/
@OutputFileClass()
public class TimestepPedestrianIdOutputFile extends OutputFile<TimestepPedestrianIdKey> {
public TimestepPedestrianIdOutputFile() {
......
package org.vadere.simulator.projects.dataprocessing.outputfile;
import org.vadere.annotation.factories.OutputFileClass;
import org.vadere.simulator.projects.dataprocessing.datakey.TimestepPositionKey;
@OutputFileClass()
public class TimestepPositionOutputFile extends OutputFile<TimestepPositionKey> {
public TimestepPositionOutputFile() {
super(TimestepPositionKey.getHeaders());
......
package org.vadere.simulator.projects.dataprocessing.outputfile;
import org.vadere.annotation.factories.OutputFileClass;
import org.vadere.simulator.projects.dataprocessing.datakey.TimestepRowKey;
@OutputFileClass()
public class TimestepRowOutputFile extends OutputFile<TimestepRowKey> {
public TimestepRowOutputFile() {
super("timeStep", "row");
......
......@@ -4,13 +4,13 @@ import org.vadere.simulator.projects.dataprocessing.ProcessorManager;
import org.vadere.state.attributes.processor.AttributesAreaDensityVoronoiProcessor;
import org.vadere.state.attributes.processor.AttributesProcessor;
import org.vadere.annotation.factories.processor.DataProcessorClass;
import org.vadere.annotation.factories.DataProcessorClass;
/**
* @author Mario Teixeira Parente
*
*/
@DataProcessorClass(name = "AreaDensityVoronoiProcessor")
@DataProcessorClass(label = "AreaDensityVoronoiProcessor")
public class AreaDensityVoronoiProcessor extends AreaDensityProcessor {
public AreaDensityVoronoiProcessor(){
......
......@@ -11,13 +11,13 @@ import org.vadere.util.geometry.shapes.VPoint;
import java.util.Map;
import org.vadere.annotation.factories.processor.DataProcessorClass;
import org.vadere.annotation.factories.DataProcessorClass;
/**
* @author Mario Teixeira Parente
*
*/
@DataProcessorClass(name = "AreaSpeedProcessor")
@DataProcessorClass(label = "AreaSpeedProcessor")
public class AreaSpeedProcessor extends AreaDataProcessor<Double> {
private PedestrianPositionProcessor pedPosProc;
private PedestrianVelocityProcessor pedVelProc;
......
package org.vadere.simulator.projects.dataprocessing.processor;
import org.vadere.annotation.factories.DataProcessorClass;
import org.vadere.simulator.control.SimulationState;
import org.vadere.simulator.projects.dataprocessing.ProcessorManager;
import org.vadere.simulator.projects.dataprocessing.datakey.NoDataKey;
......@@ -12,7 +13,7 @@ import java.util.Collections;
* @author Mario Teixeira Parente
*
*/
@DataProcessorClass()
public class EvacuationTimeProcessor extends DataProcessor<NoDataKey, Double> {
private PedestrianEvacuationTimeProcessor pedEvacTimeProc;
......
package org.vadere.simulator.projects.dataprocessing.processor;
import org.vadere.annotation.factories.DataProcessorClass;
import org.vadere.simulator.control.SimulationState;
import org.vadere.simulator.projects.dataprocessing.ProcessorManager;
import org.vadere.simulator.projects.dataprocessing.datakey.NoDataKey;
......@@ -12,7 +13,7 @@ import java.util.stream.Collectors;
/**
* @author Mario Teixeira Parente
*/
@DataProcessorClass()
public class MeanPedestrianEvacuationTimeProcessor extends DataProcessor<NoDataKey, Double> {
private PedestrianEvacuationTimeProcessor pedEvacTimeProc;
......
package org.vadere.simulator.projects.dataprocessing.processor;
import org.vadere.annotation.factories.DataProcessorClass;
import org.vadere.simulator.projects.dataprocessing.ProcessorManager;
import org.vadere.state.attributes.processor.AttributesPedestrianDensityCountingProcessor;
import org.vadere.state.attributes.processor.AttributesProcessor;
......@@ -8,7 +9,7 @@ import org.vadere.state.attributes.processor.AttributesProcessor;
* @author Mario Teixeira Parente
*
*/
@DataProcessorClass()
public class PedestrianDensityCountingProcessor extends PedestrianDensityProcessor {
public PedestrianDensityCountingProcessor(){
......
package org.vadere.simulator.projects.dataprocessing.processor;
import org.vadere.annotation.factories.DataProcessorClass;
import org.vadere.simulator.projects.dataprocessing.ProcessorManager;
import org.vadere.state.attributes.processor.AttributesPedestrianDensityGaussianProcessor;
import org.vadere.state.attributes.processor.AttributesProcessor;
......@@ -8,7 +9,7 @@ import org.vadere.state.attributes.processor.AttributesProcessor;
* @author Mario Teixeira Parente
*
*/
@DataProcessorClass()
public class PedestrianDensityGaussianProcessor extends PedestrianDensityProcessor {
public PedestrianDensityGaussianProcessor () {
......
package org.vadere.simulator.projects.dataprocessing.processor;
import org.vadere.annotation.factories.DataProcessorClass;
import org.vadere.simulator.control.SimulationState;
import org.vadere.simulator.projects.dataprocessing.ProcessorManager;
import org.vadere.simulator.projects.dataprocessing.datakey.PedestrianIdKey;
......@@ -11,7 +12,7 @@ import java.util.Collection;
* @author Mario Teixeira Parente
*
*/
@DataProcessorClass()
public class PedestrianEndTimeProcessor extends DataProcessor<PedestrianIdKey, Double> {
public PedestrianEndTimeProcessor() {
super("endTime");
......
package org.vadere.simulator.projects.dataprocessing.processor;
import org.vadere.annotation.factories.DataProcessorClass;
import org.vadere.simulator.control.SimulationState;
import org.vadere.simulator.projects.dataprocessing.ProcessorManager;
import org.vadere.simulator.projects.dataprocessing.datakey.PedestrianIdKey;
......@@ -20,7 +21,7 @@ import org.vadere.state.scenario.Pedestrian;
* @author Jakob Schöttl
*
*/
@DataProcessorClass()
public class PedestrianEvacuationTimeProcessor extends DataProcessor<PedestrianIdKey, Double> {
private PedestrianStartTimeProcessor pedStartTimeProc;
......
package org.vadere.simulator.projects.dataprocessing.processor;
import org.vadere.annotation.factories.DataProcessorClass;
import org.vadere.simulator.control.SimulationState;
import org.vadere.simulator.projects.dataprocessing.ProcessorManager;
import org.vadere.simulator.projects.dataprocessing.datakey.TimestepPedestrianIdKey;
......@@ -13,7 +14,7 @@ import java.util.stream.Collectors;
* @author Mario Teixeira Parente
*
*/
@DataProcessorClass()
public class PedestrianFlowProcessor extends DataProcessor<TimestepPedestrianIdKey, Double> {
private PedestrianVelocityProcessor pedVelProc;
private PedestrianDensityProcessor pedDensProc;
......
package org.vadere.simulator.projects.dataprocessing.processor;
import org.vadere.annotation.factories.DataProcessorClass;
import org.vadere.simulator.control.SimulationState;
import org.vadere.simulator.projects.dataprocessing.ProcessorManager;
import org.vadere.simulator.projects.dataprocessing.datakey.PedestrianIdKey;
......@@ -14,7 +15,7 @@ import java.util.Collection;
/**
* @author Mario Teixeira Parente
*/
@DataProcessorClass()
public class PedestrianLastPositionProcessor extends DataProcessor<PedestrianIdKey, VPoint> {
private PedestrianPositionProcessor pedPosProc;
......
package org.vadere.simulator.projects.dataprocessing.processor;
import org.vadere.annotation.factories.DataProcessorClass;
import org.vadere.simulator.control.SimulationState;
import org.vadere.simulator.models.Model;
import org.vadere.simulator.models.osm.OptimalStepsModel;
......@@ -16,7 +17,7 @@ import java.util.stream.Collectors;
/**
* @author Mario Teixeira Parente
*/
@DataProcessorClass()
public class PedestrianOSMStrideLengthProcessor extends DataProcessor<TimestepPedestrianIdKey, Double> {
private OptimalStepsModel osm;
......
package org.vadere.simulator.projects.dataprocessing.processor;
import org.vadere.annotation.factories.DataProcessorClass;
import org.vadere.simulator.control.SimulationState;
import org.vadere.simulator.projects.dataprocessing.ProcessorManager;
import org.vadere.simulator.projects.dataprocessing.datakey.TimestepPedestrianIdKey;
......@@ -13,7 +14,7 @@ import java.util.Collection;
/**
* @author Mario Teixeira Parente
*/
@DataProcessorClass()
public class PedestrianOverlapProcessor extends DataProcessor<TimestepPedestrianIdKey, Integer> {
private double pedRadius;
......
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