Commit 6c627813 authored by Stefan Schuhbaeck's avatar Stefan Schuhbaeck
Browse files

Merge branch 'measurementAreaRefactorProcessors_rebased' into 'master'

Measurement area refactor processors rebased

See merge request !55
parents dcffc7d3 83cb5e48
Pipeline #103785 passed with stages
in 137 minutes and 9 seconds
...@@ -6,20 +6,26 @@ import org.vadere.annotation.factories.dataprocessors.DataProcessorClass; ...@@ -6,20 +6,26 @@ import org.vadere.annotation.factories.dataprocessors.DataProcessorClass;
import org.vadere.simulator.control.SimulationState; import org.vadere.simulator.control.SimulationState;
import org.vadere.simulator.projects.dataprocessing.ProcessorManager; import org.vadere.simulator.projects.dataprocessing.ProcessorManager;
import org.vadere.simulator.projects.dataprocessing.datakey.PedestrianIdKey; import org.vadere.simulator.projects.dataprocessing.datakey.PedestrianIdKey;
import org.vadere.simulator.projects.dataprocessing.flags.UsesMeasurementArea;
import org.vadere.state.attributes.processor.AttributesCrossingTimeProcessor; import org.vadere.state.attributes.processor.AttributesCrossingTimeProcessor;
import org.vadere.state.attributes.processor.AttributesProcessor; import org.vadere.state.attributes.processor.AttributesProcessor;
import org.vadere.state.scenario.MeasurementArea;
import org.vadere.state.scenario.Pedestrian; import org.vadere.state.scenario.Pedestrian;
import org.vadere.state.simulation.FootStep; import org.vadere.state.simulation.FootStep;
import org.vadere.util.factory.processors.Flag;
import org.vadere.util.geometry.shapes.VRectangle; import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.logging.Logger; import org.vadere.util.logging.Logger;
import java.util.Collection; import java.util.Collection;
import java.util.List;
//TODO //TODO
@DataProcessorClass() @DataProcessorClass()
public class PedestrianCrossingTimeProcessor extends DataProcessor<PedestrianIdKey, Pair<Double, Double>>{ public class PedestrianCrossingTimeProcessor extends DataProcessor<PedestrianIdKey, Pair<Double, Double>> implements UsesMeasurementArea {
private MeasurementArea measurementArea;
private VRectangle measurementAreaVRec;
private VRectangle measurementArea;
private static Logger logger = Logger.getLogger(PedestrianCrossingTimeProcessor.class); private static Logger logger = Logger.getLogger(PedestrianCrossingTimeProcessor.class);
public PedestrianCrossingTimeProcessor() { public PedestrianCrossingTimeProcessor() {
...@@ -35,9 +41,9 @@ public class PedestrianCrossingTimeProcessor extends DataProcessor<PedestrianIdK ...@@ -35,9 +41,9 @@ public class PedestrianCrossingTimeProcessor extends DataProcessor<PedestrianIdK
PedestrianIdKey key = new PedestrianIdKey(ped.getId()); PedestrianIdKey key = new PedestrianIdKey(ped.getId());
for(FootStep footStep : ped.getFootSteps()) { for(FootStep footStep : ped.getFootSteps()) {
if(footStep.intersects(measurementArea)) { if(footStep.intersects(measurementAreaVRec)) {
double intersectionTime = footStep.computeIntersectionTime(measurementArea); double intersectionTime = footStep.computeIntersectionTime(measurementAreaVRec);
if(!hasCrossStartTime(key)) { if(!hasCrossStartTime(key)) {
setStartTime(key, intersectionTime); setStartTime(key, intersectionTime);
} }
...@@ -75,7 +81,13 @@ public class PedestrianCrossingTimeProcessor extends DataProcessor<PedestrianIdK ...@@ -75,7 +81,13 @@ public class PedestrianCrossingTimeProcessor extends DataProcessor<PedestrianIdK
public void init(final ProcessorManager manager) { public void init(final ProcessorManager manager) {
super.init(manager); super.init(manager);
AttributesCrossingTimeProcessor att = (AttributesCrossingTimeProcessor) this.getAttributes(); AttributesCrossingTimeProcessor att = (AttributesCrossingTimeProcessor) this.getAttributes();
this.measurementArea = att.getMeasurementArea(); this.measurementArea = manager.getMeasurementArea(att.getMeasurementAreaId());
if (measurementArea == null)
throw new RuntimeException(String.format("MeasurementArea with index %d does not exist.", att.getMeasurementAreaId()));
if (!measurementArea.isRectangular())
throw new RuntimeException("DataProcessor and IntegralVoronoiAlgorithm only supports Rectangular measurement areas.");
measurementAreaVRec = measurementArea.asVRectangle();
} }
@Override @Override
...@@ -91,4 +103,11 @@ public class PedestrianCrossingTimeProcessor extends DataProcessor<PedestrianIdK ...@@ -91,4 +103,11 @@ public class PedestrianCrossingTimeProcessor extends DataProcessor<PedestrianIdK
Pair<Double, Double> times = getValue(key); Pair<Double, Double> times = getValue(key);
return new String[]{Double.toString(times.getLeft()), Double.toString(times.getRight())}; return new String[]{Double.toString(times.getLeft()), Double.toString(times.getRight())};
} }
@Override
public int[] getReferencedMeasurementAreaId() {
AttributesCrossingTimeProcessor att = (AttributesCrossingTimeProcessor) this.getAttributes();
return new int[]{att.getWaitingAreaId(), att.getMeasurementAreaId()};
}
} }
...@@ -4,20 +4,25 @@ import org.vadere.annotation.factories.dataprocessors.DataProcessorClass; ...@@ -4,20 +4,25 @@ import org.vadere.annotation.factories.dataprocessors.DataProcessorClass;
import org.vadere.simulator.control.SimulationState; import org.vadere.simulator.control.SimulationState;
import org.vadere.simulator.projects.dataprocessing.ProcessorManager; import org.vadere.simulator.projects.dataprocessing.ProcessorManager;
import org.vadere.simulator.projects.dataprocessing.datakey.PedestrianIdKey; import org.vadere.simulator.projects.dataprocessing.datakey.PedestrianIdKey;
import org.vadere.simulator.projects.dataprocessing.flags.UsesMeasurementArea;
import org.vadere.state.attributes.processor.AttributesPedestrianWaitingEndTimeProcessor; import org.vadere.state.attributes.processor.AttributesPedestrianWaitingEndTimeProcessor;
import org.vadere.state.attributes.processor.AttributesProcessor; import org.vadere.state.attributes.processor.AttributesProcessor;
import org.vadere.state.scenario.MeasurementArea;
import org.vadere.state.scenario.Pedestrian; import org.vadere.state.scenario.Pedestrian;
import org.vadere.util.factory.processors.Flag;
import org.vadere.util.geometry.shapes.VPoint; import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VRectangle; import org.vadere.util.geometry.shapes.VRectangle;
import java.util.Collection; import java.util.Collection;
import java.util.List;
/** /**
* @author Mario Teixeira Parente * @author Mario Teixeira Parente
*/ */
@DataProcessorClass() @DataProcessorClass()
public class PedestrianWaitingEndTimeProcessor extends DataProcessor<PedestrianIdKey, Double> { public class PedestrianWaitingEndTimeProcessor extends DataProcessor<PedestrianIdKey, Double> implements UsesMeasurementArea {
private VRectangle waitingArea; private MeasurementArea waitingArea;
private VRectangle waitingAreaVRec;
public PedestrianWaitingEndTimeProcessor() { public PedestrianWaitingEndTimeProcessor() {
super("waitingEndTime"); super("waitingEndTime");
...@@ -31,7 +36,7 @@ public class PedestrianWaitingEndTimeProcessor extends DataProcessor<PedestrianI ...@@ -31,7 +36,7 @@ public class PedestrianWaitingEndTimeProcessor extends DataProcessor<PedestrianI
int pedId = p.getId(); int pedId = p.getId();
VPoint pos = p.getPosition(); VPoint pos = p.getPosition();
if (this.waitingArea.contains(pos)) { if (this.waitingAreaVRec.contains(pos)) {
PedestrianIdKey key = new PedestrianIdKey(pedId); PedestrianIdKey key = new PedestrianIdKey(pedId);
this.putValue(key, state.getSimTimeInSec()); this.putValue(key, state.getSimTimeInSec());
} }
...@@ -42,7 +47,12 @@ public class PedestrianWaitingEndTimeProcessor extends DataProcessor<PedestrianI ...@@ -42,7 +47,12 @@ public class PedestrianWaitingEndTimeProcessor extends DataProcessor<PedestrianI
public void init(final ProcessorManager manager) { public void init(final ProcessorManager manager) {
super.init(manager); super.init(manager);
AttributesPedestrianWaitingEndTimeProcessor att = (AttributesPedestrianWaitingEndTimeProcessor) this.getAttributes(); AttributesPedestrianWaitingEndTimeProcessor att = (AttributesPedestrianWaitingEndTimeProcessor) this.getAttributes();
this.waitingArea = att.getWaitingArea(); this.waitingArea = manager.getMeasurementArea(att.getWaitingAreaId());
if (waitingArea == null )
throw new RuntimeException(String.format("MeasurementArea with index %d does not exist.", att.getWaitingAreaId()));
if (!waitingArea.isRectangular())
throw new RuntimeException("DataProcessor and IntegralVoronoiAlgorithm only supports Rectangular measurement areas.");
waitingAreaVRec = waitingArea.asVRectangle();
} }
@Override @Override
...@@ -53,4 +63,11 @@ public class PedestrianWaitingEndTimeProcessor extends DataProcessor<PedestrianI ...@@ -53,4 +63,11 @@ public class PedestrianWaitingEndTimeProcessor extends DataProcessor<PedestrianI
return super.getAttributes(); return super.getAttributes();
} }
@Override
public int[] getReferencedMeasurementAreaId() {
AttributesPedestrianWaitingEndTimeProcessor att = (AttributesPedestrianWaitingEndTimeProcessor) this.getAttributes();
return new int[]{att.getWaitingAreaId()};
}
} }
...@@ -4,21 +4,26 @@ import org.vadere.annotation.factories.dataprocessors.DataProcessorClass; ...@@ -4,21 +4,26 @@ import org.vadere.annotation.factories.dataprocessors.DataProcessorClass;
import org.vadere.simulator.control.SimulationState; import org.vadere.simulator.control.SimulationState;
import org.vadere.simulator.projects.dataprocessing.ProcessorManager; import org.vadere.simulator.projects.dataprocessing.ProcessorManager;
import org.vadere.simulator.projects.dataprocessing.datakey.PedestrianIdKey; import org.vadere.simulator.projects.dataprocessing.datakey.PedestrianIdKey;
import org.vadere.simulator.projects.dataprocessing.flags.UsesMeasurementArea;
import org.vadere.state.attributes.processor.AttributesPedestrianWaitingTimeProcessor; import org.vadere.state.attributes.processor.AttributesPedestrianWaitingTimeProcessor;
import org.vadere.state.attributes.processor.AttributesProcessor; import org.vadere.state.attributes.processor.AttributesProcessor;
import org.vadere.state.scenario.MeasurementArea;
import org.vadere.state.scenario.Pedestrian; import org.vadere.state.scenario.Pedestrian;
import org.vadere.util.factory.processors.Flag;
import org.vadere.util.geometry.shapes.VPoint; import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VRectangle; import org.vadere.util.geometry.shapes.VRectangle;
import java.util.Collection; import java.util.Collection;
import java.util.List;
/** /**
* @author Mario Teixeira Parente * @author Mario Teixeira Parente
*/ */
@DataProcessorClass() @DataProcessorClass()
public class PedestrianWaitingTimeProcessor extends DataProcessor<PedestrianIdKey, Double> { public class PedestrianWaitingTimeProcessor extends DataProcessor<PedestrianIdKey, Double> implements UsesMeasurementArea {
private double lastSimTime; private double lastSimTime;
private VRectangle waitingArea; private MeasurementArea waitingArea;
private VRectangle waitingAreaRec;
public PedestrianWaitingTimeProcessor() { public PedestrianWaitingTimeProcessor() {
super("waitingTimeStart"); super("waitingTimeStart");
...@@ -36,7 +41,7 @@ public class PedestrianWaitingTimeProcessor extends DataProcessor<PedestrianIdKe ...@@ -36,7 +41,7 @@ public class PedestrianWaitingTimeProcessor extends DataProcessor<PedestrianIdKe
int pedId = p.getId(); int pedId = p.getId();
VPoint pos = p.getPosition(); VPoint pos = p.getPosition();
if (this.waitingArea.contains(pos)) { if (this.waitingAreaRec.contains(pos)) {
PedestrianIdKey key = new PedestrianIdKey(pedId); PedestrianIdKey key = new PedestrianIdKey(pedId);
this.putValue(key, (this.hasValue(key) ? this.getValue(key) : 0.0) + dt); this.putValue(key, (this.hasValue(key) ? this.getValue(key) : 0.0) + dt);
} }
...@@ -49,7 +54,12 @@ public class PedestrianWaitingTimeProcessor extends DataProcessor<PedestrianIdKe ...@@ -49,7 +54,12 @@ public class PedestrianWaitingTimeProcessor extends DataProcessor<PedestrianIdKe
public void init(final ProcessorManager manager) { public void init(final ProcessorManager manager) {
super.init(manager); super.init(manager);
AttributesPedestrianWaitingTimeProcessor att = (AttributesPedestrianWaitingTimeProcessor) this.getAttributes(); AttributesPedestrianWaitingTimeProcessor att = (AttributesPedestrianWaitingTimeProcessor) this.getAttributes();
this.waitingArea = att.getWaitingArea(); this.waitingArea = manager.getMeasurementArea(att.getWaitingAreaId());
if (waitingArea == null)
throw new RuntimeException(String.format("MeasurementArea with index %d does not exist.", att.getWaitingAreaId()));
if (!waitingArea.isRectangular())
throw new RuntimeException("DataProcessor and IntegralVoronoiAlgorithm only supports Rectangular measurement areas.");
waitingAreaRec = waitingArea.asVRectangle();
this.lastSimTime = 0.0; this.lastSimTime = 0.0;
} }
...@@ -61,4 +71,10 @@ public class PedestrianWaitingTimeProcessor extends DataProcessor<PedestrianIdKe ...@@ -61,4 +71,10 @@ public class PedestrianWaitingTimeProcessor extends DataProcessor<PedestrianIdKe
return super.getAttributes(); return super.getAttributes();
} }
@Override
public int[] getReferencedMeasurementAreaId() {
AttributesPedestrianWaitingTimeProcessor att = (AttributesPedestrianWaitingTimeProcessor) this.getAttributes();
return new int[]{att.getWaitingAreaId()};
}
} }
...@@ -4,6 +4,7 @@ import org.jetbrains.annotations.NotNull; ...@@ -4,6 +4,7 @@ import org.jetbrains.annotations.NotNull;
import org.vadere.simulator.control.SimulationState; import org.vadere.simulator.control.SimulationState;
import org.vadere.simulator.projects.dataprocessing.datakey.TimestepPedestrianIdKey; import org.vadere.simulator.projects.dataprocessing.datakey.TimestepPedestrianIdKey;
import org.vadere.state.scenario.Agent; import org.vadere.state.scenario.Agent;
import org.vadere.state.scenario.MeasurementArea;
import org.vadere.util.geometry.GeometryUtils; import org.vadere.util.geometry.GeometryUtils;
import org.vadere.util.geometry.shapes.VPoint; import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VPolygon; import org.vadere.util.geometry.shapes.VPolygon;
...@@ -25,12 +26,12 @@ public class SumVoronoiAlgorithm extends AreaDensityAlgorithm implements IAreaVe ...@@ -25,12 +26,12 @@ public class SumVoronoiAlgorithm extends AreaDensityAlgorithm implements IAreaVe
private VRectangle voronoiArea; private VRectangle voronoiArea;
private final Function<TimestepPedestrianIdKey, Double> agentVelocityFunc; private final Function<TimestepPedestrianIdKey, Double> agentVelocityFunc;
public SumVoronoiAlgorithm(@NotNull final Function<TimestepPedestrianIdKey, Double> agentVelocityFunc, @NotNull final VRectangle measurementArea, @NotNull final VRectangle voronoiArea) { public SumVoronoiAlgorithm(@NotNull final Function<TimestepPedestrianIdKey, Double> agentVelocityFunc, @NotNull final MeasurementArea measurementArea, @NotNull final MeasurementArea voronoiArea) {
super("areaVoronoi"); super("areaVoronoi");
this.measurementArea = measurementArea; this.measurementArea = measurementArea.asVRectangle();
this.measurementAreaPolygon = new VPolygon(measurementArea); this.measurementAreaPolygon = new VPolygon(measurementArea.getShape());
this.voronoiArea = voronoiArea; this.voronoiArea = voronoiArea.asVRectangle();
this.agentVelocityFunc = agentVelocityFunc; this.agentVelocityFunc = agentVelocityFunc;
} }
......
package org.vadere.simulator.projects.migration; package org.vadere.simulator.projects.migration;
import org.vadere.simulator.entrypoints.Version; import org.vadere.simulator.entrypoints.Version;
import org.vadere.simulator.projects.migration.incident.IncidentMigrationAssistant;
import org.vadere.simulator.projects.migration.jsontranformation.JsonMigrationAssistant;
import org.vadere.util.io.IOUtils; import org.vadere.util.io.IOUtils;
import java.io.IOException; import java.io.IOException;
...@@ -8,9 +10,6 @@ import java.nio.file.Path; ...@@ -8,9 +10,6 @@ import java.nio.file.Path;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
public abstract class MigrationAssistant { public abstract class MigrationAssistant {
public static final String INCIDENT_ORDER_ERROR = "An incident that was found applicable couldn't be resolved. " +
"That means, that a previously resolved incident rendered this one no longer applicable. " +
"Check the order of the incidents in the IncidentDatabase for logical flaws.";
protected final MigrationOptions migrationOptions; protected final MigrationOptions migrationOptions;
public MigrationAssistant(MigrationOptions migrationOptions) { public MigrationAssistant(MigrationOptions migrationOptions) {
...@@ -21,7 +20,7 @@ public abstract class MigrationAssistant { ...@@ -21,7 +20,7 @@ public abstract class MigrationAssistant {
if (options.isUseDeprecatedAssistant()) { if (options.isUseDeprecatedAssistant()) {
return new IncidentMigrationAssistant(options); return new IncidentMigrationAssistant(options);
} else { } else {
return new JoltMigrationAssistant(options); return new JsonMigrationAssistant(options);
} }
} }
...@@ -34,15 +33,37 @@ public abstract class MigrationAssistant { ...@@ -34,15 +33,37 @@ public abstract class MigrationAssistant {
public abstract void restLog(); public abstract void restLog();
public abstract MigrationResult analyzeProject(String projectFolderPath) throws IOException;
protected String getTimestamp() { protected String getTimestamp() {
return new SimpleDateFormat("yyyyMMddHHmmss").format(new java.util.Date()); return new SimpleDateFormat("yyyyMMddHHmmss").format(new java.util.Date());
} }
public abstract String convertFile(Path scenarioFilePath, Version targetVersion) throws MigrationException; public abstract MigrationResult analyzeProject(String projectFolderPath) throws IOException;
/**
* Migrate a given serialized scenario file to the target version.
* @param scenarioFilePath Path to scenario file
* @param targetVersion Version number to which it should be upgraded.
* @return String representation (JSON) of the serialized scenario
* @throws MigrationException
*/
public abstract String migrateScenarioFile(Path scenarioFilePath, Version targetVersion) throws MigrationException;
/**
* Migrate a given serialized scenario file to the target version and save the result to a file.
* @param scenarioFilePath Path to scenario file
* @param targetVersion Version number to which it should be upgraded.
* @param outputFile If Null overwrite existing file. Backup as {filename}.legacy
* @throws MigrationException
*/
public abstract void migrateScenarioFile(Path scenarioFilePath, Version targetVersion, Path outputFile) throws MigrationException;
public abstract void migrateFile(Path scenarioFilePath, Version targetVersion, Path outputFile) throws MigrationException; /**
* Search for existing backup files at default location.
* @param scenarioFile Path to scenario file
* @throws MigrationException
*/
public abstract void revertFile(Path scenarioFile) throws MigrationException; public abstract void revertFile(Path scenarioFile) throws MigrationException;
} }
package org.vadere.simulator.projects.migration; package org.vadere.simulator.projects.migration;
import org.vadere.simulator.projects.migration.incidents.Incident; import org.vadere.simulator.projects.migration.incident.incidents.Incident;
public class MigrationException extends Exception { public class MigrationException extends Exception {
...@@ -13,6 +13,10 @@ public class MigrationException extends Exception { ...@@ -13,6 +13,10 @@ public class MigrationException extends Exception {
super(message); super(message);
} }
public MigrationException(Throwable throwable) {
super(throwable);
}
public MigrationException(String message, Throwable cause) { public MigrationException(String message, Throwable cause) {
super(message, cause); super(message, cause);
} }
......
package org.vadere.simulator.projects.migration; package org.vadere.simulator.projects.migration.incident;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
...@@ -8,15 +8,15 @@ import java.util.List; ...@@ -8,15 +8,15 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import org.vadere.simulator.entrypoints.Version; import org.vadere.simulator.entrypoints.Version;
import org.vadere.simulator.projects.migration.incidents.AddTextNodeIncident; import org.vadere.simulator.projects.migration.incident.incidents.AddTextNodeIncident;
import org.vadere.simulator.projects.migration.incidents.DeletionIncident; import org.vadere.simulator.projects.migration.incident.incidents.DeletionIncident;
import org.vadere.simulator.projects.migration.incidents.Incident; import org.vadere.simulator.projects.migration.incident.incidents.Incident;
import org.vadere.simulator.projects.migration.incidents.MissingMainModelIncident; import org.vadere.simulator.projects.migration.incident.incidents.MissingMainModelIncident;
import org.vadere.simulator.projects.migration.incidents.RelocationIncident; import org.vadere.simulator.projects.migration.incident.incidents.RelocationIncident;
import org.vadere.simulator.projects.migration.incidents.RenameInArrayIncident; import org.vadere.simulator.projects.migration.incident.incidents.RenameInArrayIncident;
import org.vadere.simulator.projects.migration.incidents.RenameIncident; import org.vadere.simulator.projects.migration.incident.incidents.RenameIncident;
import org.vadere.simulator.projects.migration.incidents.specialized.AttributesPotentialCompactVSosmIncident; import org.vadere.simulator.projects.migration.incident.incidents.specialized.AttributesPotentialCompactVSosmIncident;
import org.vadere.simulator.projects.migration.incidents.specialized.MoveSpawnDelayIntoDistributionParametersIncident; import org.vadere.simulator.projects.migration.incident.incidents.specialized.MoveSpawnDelayIntoDistributionParametersIncident;
import org.vadere.state.util.StateJsonConverter; import org.vadere.state.util.StateJsonConverter;
import static org.vadere.simulator.entrypoints.Version.*; import static org.vadere.simulator.entrypoints.Version.*;
......
package org.vadere.simulator.projects.migration; package org.vadere.simulator.projects.migration.incident;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import org.vadere.simulator.entrypoints.Version; import org.vadere.simulator.entrypoints.Version;
import org.vadere.simulator.projects.migration.incidents.ExceptionIncident; import org.vadere.simulator.projects.migration.MigrationAssistant;
import org.vadere.simulator.projects.migration.incidents.Incident; import org.vadere.simulator.projects.migration.MigrationException;
import org.vadere.simulator.projects.migration.incidents.VersionBumpIncident; import org.vadere.simulator.projects.migration.MigrationOptions;
import org.vadere.simulator.projects.migration.MigrationResult;
import org.vadere.simulator.projects.migration.incident.incidents.ExceptionIncident;
import org.vadere.simulator.projects.migration.incident.incidents.Incident;
import org.vadere.simulator.projects.migration.incident.incidents.VersionBumpIncident;
import org.vadere.state.util.StateJsonConverter; import org.vadere.state.util.StateJsonConverter;
import org.vadere.util.io.IOUtils; import org.vadere.util.io.IOUtils;
import org.vadere.util.logging.Logger; import org.vadere.util.logging.Logger;
...@@ -70,12 +74,12 @@ public class IncidentMigrationAssistant extends MigrationAssistant { ...@@ -70,12 +74,12 @@ public class IncidentMigrationAssistant extends MigrationAssistant {
} }
@Override @Override
public String convertFile(Path scenarioFilePath, Version targetVersion) { public String migrateScenarioFile(Path scenarioFilePath, Version targetVersion) {
throw new RuntimeException("Not Implemented"); throw new RuntimeException("Not Implemented");
} }
@Override @Override
public void migrateFile(Path scenarioFilePath, Version targetVersion, Path outputFile) { public void migrateScenarioFile(Path scenarioFilePath, Version targetVersion, Path outputFile) {
throw new RuntimeException("Not Implemented"); throw new RuntimeException("Not Implemented");
} }
......
package org.vadere.simulator.projects.migration; package org.vadere.simulator.projects.migration.incident;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
......
package org.vadere.simulator.projects.migration; package org.vadere.simulator.projects.migration.incident;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.ObjectNode;
...@@ -7,7 +7,8 @@ import java.util.*; ...@@ -7,7 +7,8 @@ import java.util.*;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.vadere.simulator.projects.migration.incidents.Incident; import org.vadere.simulator.projects.migration.MigrationException;
import org.vadere.simulator.projects.migration.incident.incidents.Incident;
/** /**
* A Tree that represents the json-tree. Note that JsonArrays are always leafs! Therefore it is * A Tree that represents the json-tree. Note that JsonArrays are always leafs! Therefore it is
......
package org.vadere.simulator.projects.migration.helper; package org.vadere.simulator.projects.migration.incident.helper;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;