2.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 4a1d1bf3 authored by Daniel Lehmberg's avatar Daniel Lehmberg
Browse files

resolve merge conflict of develop -> remove_reflection

parents 7254bec4 d7f24dfa
Pipeline #59594 passed with stage
in 48 seconds
......@@ -106,12 +106,14 @@ public class ScenarioElementView extends JPanel implements ISelectScenarioElemen
}
@Override
public void removeUpdate(DocumentEvent e) {
public void removeUpdate(DocumentEvent e)
{
updateModel();
}
@Override
public void changedUpdate(DocumentEvent e) {
updateModel();
}
};
......@@ -126,7 +128,7 @@ public class ScenarioElementView extends JPanel implements ISelectScenarioElemen
ScenarioElement element = panelModel.getSelectedElement();
if (element != null) {
String json = txtrTextfiletextarea.getText();
//logger.info(json);
if (json.length() == 0)
return;
......
......@@ -6,6 +6,7 @@ import org.vadere.gui.projectview.view.ProjectView;
import org.vadere.state.attributes.models.AttributesBHM;
import org.vadere.util.io.IOUtils;
import java.awt.*;
import java.io.IOException;
import java.util.prefs.BackingStoreException;
import java.util.prefs.InvalidPreferencesFormatException;
......
......@@ -109,12 +109,14 @@ public class ProjectView extends JFrame implements ProjectFinishedListener, Sing
// ##################
@Override
public void postProjectRun(final VadereProject scenario) {
scenariosRunning = false;
model.refreshOutputTable();
setScenariosRunning(false);
progressPanel.setData(Messages.getString("ProgressPanelDone.text"), 100);
scenarioJPanel.showEditScenario();
selectCurrentScenarioRunManager();
EventQueue.invokeLater(() -> {
scenariosRunning = false;
model.refreshOutputTable();
setScenariosRunning(false);
progressPanel.setData(Messages.getString("ProgressPanelDone.text"), 100);
scenarioJPanel.showEditScenario();
selectCurrentScenarioRunManager();
});
}
private void selectCurrentScenarioRunManager() {
......@@ -127,58 +129,71 @@ public class ProjectView extends JFrame implements ProjectFinishedListener, Sing
@Override
public void preProjectRun(final VadereProject project) {
setScenariosRunning(true);
progressPanel.setData(Messages.getString("ProgressPanelWorking.text"), 0);
EventQueue.invokeLater(() -> {
setScenariosRunning(true);
progressPanel.setData(Messages.getString("ProgressPanelWorking.text"), 0);
});
}
@Override
public void preScenarioRun(final Scenario scenario, final int scenariosLeft) {
model.setScenarioNameLabel(scenario.getName());
repaint();
EventQueue.invokeLater(() -> {
model.setScenarioNameLabel(scenario.getName());
repaint();
});
}
@Override
public void postScenarioRun(final Scenario cloneScenario, final int scenarioLeft) {
// take the original!
replace(cloneScenario, VadereState.INITIALIZED);
// model.refreshOutputTable();
// find index of scenario
int totalScenariosCount = model.getProject().getScenarios().size();
int doneScenariosCount = totalScenariosCount - scenarioLeft;
progressPanel.setData(Messages.getString("ProgressPanelWorking.text"), 100 * doneScenariosCount
/ totalScenariosCount);
logger.info(String.format("scenario %s finished", cloneScenario.getName()));
EventQueue.invokeLater(() -> {
replace(cloneScenario, VadereState.INITIALIZED);
// model.refreshOutputTable();
// find index of scenario
int totalScenariosCount = model.getProject().getScenarios().size();
int doneScenariosCount = totalScenariosCount - scenarioLeft;
progressPanel.setData(Messages.getString("ProgressPanelWorking.text"), 100 * doneScenariosCount
/ totalScenariosCount);
logger.info(String.format("scenario %s finished", cloneScenario.getName()));
});
}
@Override
public void scenarioStarted(final Scenario cloneScenario, final int scenariosLeft) {
// take the original!
replace(cloneScenario, VadereState.RUNNING);
EventQueue.invokeLater(() -> {
replace(cloneScenario, VadereState.RUNNING);
});
}
@Override
public void scenarioPaused(final Scenario cloneScenario, final int scenariosLeft) {
// take the original!
replace(cloneScenario, VadereState.PAUSED);
EventQueue.invokeLater(() -> {
replace(cloneScenario, VadereState.PAUSED);
});
}
@Override
public void scenarioInterrupted(final Scenario scenario, final int scenariosLeft) {
replace(scenario, VadereState.INTERRUPTED);
setScenariosRunning(false);
selectCurrentScenarioRunManager();
logger.info(String.format("all running scenarios interrupted"));
EventQueue.invokeLater(() -> {
replace(scenario, VadereState.INTERRUPTED);
setScenariosRunning(false);
selectCurrentScenarioRunManager();
logger.info(String.format("all running scenarios interrupted"));
});
}
@Override
public void error(final Scenario scenario, final int scenarioLefts, final Throwable throwable) {
replace(scenario, VadereState.INTERRUPTED);
new Thread(
() -> {
IOUtils.errorBox(Messages.getString("ProjectView.simulationRunErrorDialog.text") + " " + scenario
+ ": " + throwable, Messages.getString("ProjectView.simulationRunErrorDialog.title"));
}).start();
EventQueue.invokeLater(() -> {
replace(scenario, VadereState.INTERRUPTED);
new Thread(
() -> {
IOUtils.errorBox(Messages.getString("ProjectView.simulationRunErrorDialog.text") + " " + scenario
+ ": " + throwable, Messages.getString("ProjectView.simulationRunErrorDialog.title"));
}).start();
});
}
private void replace(final Scenario scenarioRM, final VadereState state) {
......@@ -190,21 +205,27 @@ public class ProjectView extends JFrame implements ProjectFinishedListener, Sing
@Override
public void preRefresh() {
outputTable.setEnabled(false);
EventQueue.invokeLater(() -> {
outputTable.setEnabled(false);
});
}
@Override
public void postRefresh() {
if (!scenariosRunning)
outputTable.setEnabled(true);
EventQueue.invokeLater(() -> {
if (!scenariosRunning)
outputTable.setEnabled(true);
});
}
@Override
public void projectChanged(final VadereProject project) {
setTitle();
model.getProject().addProjectFinishedListener(this);
model.getProject().addSingleScenarioFinishedListener(this);
model.getProject().addProjectFinishedListener(scenarioJPanel);
EventQueue.invokeLater(() -> {
setTitle();
model.getProject().addProjectFinishedListener(this);
model.getProject().addSingleScenarioFinishedListener(this);
model.getProject().addProjectFinishedListener(scenarioJPanel);
});
}
@Override
......@@ -217,21 +238,23 @@ public class ProjectView extends JFrame implements ProjectFinishedListener, Sing
* Launch the application.
*/
public static void start() {
try {
// Set Java L&F from system
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (UnsupportedLookAndFeelException | ClassNotFoundException | InstantiationException
| IllegalAccessException e) {
IOUtils.errorBox("The system look and feel could not be loaded.", "Error setLookAndFeel");
}
// show GUI
ProjectViewModel model = new ProjectViewModel();
ProjectView frame = new ProjectView(model);
frame.setProjectSpecificActionsEnabled(false);
frame.setVisible(true);
frame.setSize(1200, 800);
frame.openLastUsedProject(model);
EventQueue.invokeLater(() -> {
try {
// Set Java L&F from system
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (UnsupportedLookAndFeelException | ClassNotFoundException | InstantiationException
| IllegalAccessException e) {
IOUtils.errorBox("The system look and feel could not be loaded.", "Error setLookAndFeel");
}
// show GUI
ProjectViewModel model = new ProjectViewModel();
ProjectView frame = new ProjectView(model);
frame.setProjectSpecificActionsEnabled(false);
frame.setVisible(true);
frame.setSize(1200, 800);
frame.openLastUsedProject(model);
});
}
private void openLastUsedProject(final ProjectViewModel model) {
......
{
"name" : "stairs_diagonal_1 ",
"description" : "",
"release" : "0.2",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
"filename" : "postvis.trajectories",
"processors" : [ 1, 2 ]
} ],
"processors" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianPositionProcessor",
"id" : 1
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianTargetIdProcessor",
"id" : 2
} ],
"isTimestamped" : true
},
"scenario" : {
"mainModel" : "org.vadere.simulator.models.osm.OptimalStepsModel",
"attributesModel" : {
"org.vadere.state.attributes.models.AttributesOSM" : {
"stepCircleResolution" : 18,
"numberOfCircles" : 1,
"varyStepDirection" : false,
"stepLengthIntercept" : 0.4625,
"stepLengthSlopeSpeed" : 0.2345,
"stepLengthSD" : 0.036,
"movementThreshold" : 0.0,
"optimizationType" : "DISCRETE",
"movementType" : "ARBITRARY",
"dynamicStepLength" : false,
"updateType" : "EVENT_DRIVEN",
"seeSmallWalls" : false,
"minimumStepLength" : false,
"targetPotentialModel" : "org.vadere.simulator.models.potential.fields.PotentialFieldTargetGrid",
"pedestrianPotentialModel" : "org.vadere.simulator.models.potential.PotentialFieldPedestrianCompactSoftshell",
"obstaclePotentialModel" : "org.vadere.simulator.models.potential.PotentialFieldObstacleCompactSoftshell",
"submodels" : [ ]
},
"org.vadere.state.attributes.models.AttributesPotentialCompactSoftshell" : {
"pedPotentialIntimateSpaceWidth" : 0.45,
"pedPotentialPersonalSpaceWidth" : 1.2,
"pedPotentialHeight" : 50.0,
"obstPotentialWidth" : 0.8,
"obstPotentialHeight" : 6.0,
"intimateSpaceFactor" : 1.2,
"personalSpacePower" : 1,
"intimateSpacePower" : 1
},
"org.vadere.state.attributes.models.AttributesFloorField" : {
"createMethod" : "HIGH_ACCURACY_FAST_MARCHING",
"potentialFieldResolution" : 0.1,
"obstacleGridPenalty" : 0.1,
"targetAttractionStrength" : 1.0,
"timeCostAttributes" : {
"standardDerivation" : 0.7,
"type" : "UNIT",
"obstacleDensityWeight" : 3.5,
"pedestrianSameTargetDensityWeight" : 3.5,
"pedestrianOtherTargetDensityWeight" : 3.5,
"pedestrianWeight" : 3.5,
"queueWidthLoading" : 1.0,
"pedestrianDynamicWeight" : 6.0,
"loadingType" : "CONSTANT"
}
}
},
"attributesSimulation" : {
"finishTime" : 70.0,
"simTimeStepLength" : 0.4,
"realTimeSimTimeRatio" : 0.1,
"writeSimulationData" : true,
"visualizationEnabled" : true,
"printFPS" : false,
"needsBoundary" : false,
"digitsPerCoordinate" : 2,
"useRandomSeed" : true,
"randomSeed" : 1
},
"topography" : {
"attributes" : {
"bounds" : {
"x" : 0.0,
"y" : 0.0,
"width" : 10.0,
"height" : 10.0
},
"boundingBoxWidth" : 0.5,
"bounded" : true
},
"obstacles" : [ {
"shape" : {
"type" : "POLYGON",
"points" : [ {
"x" : 2.2,
"y" : 0.5
}, {
"x" : 9.6,
"y" : 8.2
}, {
"x" : 9.7,
"y" : 7.7
}, {
"x" : 2.4,
"y" : 0.2
} ]
},
"id" : -1
}, {
"shape" : {
"type" : "POLYGON",
"points" : [ {
"x" : 7.0,
"y" : 9.8
}, {
"x" : 0.0,
"y" : 2.4
}, {
"x" : 0.2,
"y" : 2.1
}, {
"x" : 7.4,
"y" : 9.7
} ]
},
"id" : -1
} ],
"stairs" : [ {
"shape" : {
"type" : "POLYGON",
"points" : [ {
"x" : 1.8,
"y" : 3.9
}, {
"x" : 3.8,
"y" : 2.2
}, {
"x" : 8.0,
"y" : 6.4
}, {
"x" : 5.7,
"y" : 8.2
} ]
},
"id" : -1,
"treadCount" : 6,
"upwardDirection" : {
"x" : 1.0,
"y" : 1.0
}
} ],
"targets" : [ {
"id" : 1,
"absorbing" : true,
"shape" : {
"x" : 7.4,
"y" : 7.8,
"width" : 1.9,
"height" : 1.6,
"type" : "RECTANGLE"
},
"waitingTime" : 0.0,
"waitingTimeYellowPhase" : 0.0,
"parallelWaiters" : 0,
"individualWaiting" : true,
"deletionDistance" : 0.1,
"startingWithRedLight" : false,
"nextSpeed" : -1.0
} ],
"sources" : [ {
"id" : -1,
"shape" : {
"x" : 0.6,
"y" : 0.6,
"width" : 1.6,
"height" : 1.4,
"type" : "RECTANGLE"
},
"interSpawnTimeDistribution" : "org.vadere.state.scenario.ConstantDistribution",
"distributionParameters" : [ 1.0 ],
"spawnNumber" : 5,
"maxSpawnNumberTotal" : -1,
"startTime" : 0.0,
"endTime" : 50.0,
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
"attributesPedestrian" : {
"radius" : 0.195,
"densityDependentSpeed" : false,
"speedDistributionMean" : 1.34,
"speedDistributionStandardDeviation" : 0.26,
"minimumSpeed" : 0.5,
"maximumSpeed" : 2.2,
"acceleration" : 2.0
},
"attributesCar" : {
"id" : -1,
"radius" : 0.195,
"densityDependentSpeed" : false,
"speedDistributionMean" : 1.34,
"speedDistributionStandardDeviation" : 0.26,
"minimumSpeed" : 0.5,
"maximumSpeed" : 2.2,
"acceleration" : 2.0,
"length" : 4.5,
"width" : 1.7,
"direction" : {
"x" : 1.0,
"y" : 0.0
}
}
}
}
}
\ No newline at end of file
{
"name" : "stairs_diagonal_1 ",
"description" : "",
"release" : "0.2",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
"filename" : "postvis.trajectories",
"processors" : [ 1, 2 ]
} ],
"processors" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianPositionProcessor",
"id" : 1
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianTargetIdProcessor",
"id" : 2
} ],
"isTimestamped" : true
},
"scenario" : {
"mainModel" : "org.vadere.simulator.models.osm.OptimalStepsModel",
"attributesModel" : {
"org.vadere.state.attributes.models.AttributesOSM" : {
"stepCircleResolution" : 18,
"numberOfCircles" : 1,
"varyStepDirection" : false,
"stepLengthIntercept" : 0.4625,
"stepLengthSlopeSpeed" : 0.2345,
"stepLengthSD" : 0.036,
"movementThreshold" : 0.0,
"optimizationType" : "DISCRETE",
"movementType" : "ARBITRARY",
"dynamicStepLength" : false,
"updateType" : "EVENT_DRIVEN",
"seeSmallWalls" : false,
"minimumStepLength" : false,
"targetPotentialModel" : "org.vadere.simulator.models.potential.fields.PotentialFieldTargetGrid",
"pedestrianPotentialModel" : "org.vadere.simulator.models.potential.PotentialFieldPedestrianCompactSoftshell",
"obstaclePotentialModel" : "org.vadere.simulator.models.potential.PotentialFieldObstacleCompactSoftshell",
"submodels" : [ ]
},
"org.vadere.state.attributes.models.AttributesPotentialCompactSoftshell" : {
"pedPotentialIntimateSpaceWidth" : 0.45,
"pedPotentialPersonalSpaceWidth" : 1.2,
"pedPotentialHeight" : 50.0,
"obstPotentialWidth" : 0.8,
"obstPotentialHeight" : 6.0,
"intimateSpaceFactor" : 1.2,
"personalSpacePower" : 1,
"intimateSpacePower" : 1
},
"org.vadere.state.attributes.models.AttributesFloorField" : {
"createMethod" : "HIGH_ACCURACY_FAST_MARCHING",
"potentialFieldResolution" : 0.1,
"obstacleGridPenalty" : 0.1,
"targetAttractionStrength" : 1.0,
"timeCostAttributes" : {
"standardDerivation" : 0.7,
"type" : "UNIT",
"obstacleDensityWeight" : 3.5,
"pedestrianSameTargetDensityWeight" : 3.5,
"pedestrianOtherTargetDensityWeight" : 3.5,
"pedestrianWeight" : 3.5,
"queueWidthLoading" : 1.0,
"pedestrianDynamicWeight" : 6.0,
"loadingType" : "CONSTANT"
}
}
},
"attributesSimulation" : {
"finishTime" : 70.0,
"simTimeStepLength" : 0.4,
"realTimeSimTimeRatio" : 0.1,
"writeSimulationData" : true,
"visualizationEnabled" : true,
"printFPS" : false,
"needsBoundary" : false,
"digitsPerCoordinate" : 2,
"useRandomSeed" : true,
"randomSeed" : 1
},
"topography" : {
"attributes" : {
"bounds" : {
"x" : 0.0,
"y" : 0.0,
"width" : 10.0,
"height" : 10.0
},
"boundingBoxWidth" : 0.5,
"bounded" : true
},
"obstacles" : [ {
"shape" : {
"type" : "POLYGON",
"points" : [ {
"x" : 2.2,
"y" : 0.5
}, {
"x" : 9.6,
"y" : 8.2
}, {
"x" : 9.7,
"y" : 7.7
}, {
"x" : 2.4,
"y" : 0.2
} ]
},
"id" : -1
}, {
"shape" : {
"type" : "POLYGON",
"points" : [ {
"x" : 7.0,
"y" : 9.8
}, {
"x" : 0.0,
"y" : 2.4
}, {
"x" : 0.2,
"y" : 2.1
}, {
"x" : 7.4,
"y" : 9.7
} ]
},
"id" : -1
} ],
"stairs" : [ {
"shape" : {
"type" : "POLYGON",
"points" : [ {
"x" : 1.8,
"y" : 3.9
}, {
"x" : 3.8,
"y" : 2.2
}, {
"x" : 8.0,
"y" : 6.4
}, {
"x" : 5.7,
"y" : 8.2
} ]
},
"id" : -1,
"treadCount" : 6,
"upwardDirection" : {
"x" : 1.0,
"y" : 1.0
}
} ],
"targets" : [ {
"id" : 1,
"absorbing" : true,