The expiration time for new job artifacts in CI/CD pipelines is now 30 days (GitLab default). Previously generated artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

Commit 15cc6e4a authored by Benedikt Zoennchen's avatar Benedikt Zoennchen
Browse files

Merge branch 'master' of https://gitlab.lrz.de/vadere/vadere

parents ce962337 696a81f4
...@@ -215,7 +215,8 @@ ProjectView.OpenInExplorer.text=Open in Explorer ...@@ -215,7 +215,8 @@ ProjectView.OpenInExplorer.text=Open in Explorer
ProjectView.mntmCopyOutputDir.text=Copy output path to clipboard ProjectView.mntmCopyOutputDir.text=Copy output path to clipboard
SettingsDialog.chbShowPedestrianIds.text=Show PedestrianIds SettingsDialog.chbShowPedestrianIds.text=Show PedestrianIds
PostVis.chShowEvacTimeColor.text=Color Pedestrians regarding to Evacuation Times PostVis.chShowEvacTimeColor.text=Coloring by Evacuation Times
PostVis.chShowCriteriaColor.text=Coloring by Predicate
PostVis.additional.border.text=PostVis PostVis.additional.border.text=PostVis
PostVis.btnPlay.tooltip=Play (Space) PostVis.btnPlay.tooltip=Play (Space)
...@@ -228,12 +229,13 @@ PostVis.title=Vadere Post-Visualization ...@@ -228,12 +229,13 @@ PostVis.title=Vadere Post-Visualization
PostVis.version= Version {0} PostVis.version= Version {0}
PostVis.license.text=This product is licensed under the {0} PostVis.license.text=This product is licensed under the {0}
PostVis.chbHidePedAtTarget.text=Hide Pedestrians at Target PostVis.chbHidePedAtTarget.text=Hide disappeared Pedestrians
PostVis.chbHideTrajAtTarget.text=Hide Trajectories at Target PostVis.chbHideTrajAtTarget.text=Hide Trajectories of disappeared Pedestrians
PostVis.chShowAllTrajOnSnapshot.text=Show all Trajectories on Snapshot PostVis.chShowAllTrajOnSnapshot.text=Show all Trajectories on Snapshot
PostVis.chbCleanSnapshot.text=Hide Trajectories on Snapshots PostVis.chbCleanSnapshot.text=Hide Trajectories on Snapshots
SettingsDialog.chbUseRandomColors.text=Random Coloring SettingsDialog.chbUseRandomColors.text=Random Coloring
SettingsDialog.chbGroupColors.text=Coloring by Group
SettingsDialog.chbHideVoronoiDiagram.text=Hide VoronoiDiagram SettingsDialog.chbHideVoronoiDiagram.text=Hide VoronoiDiagram
SettingsDialog.chbShowObstacles.text=Show Obstacles SettingsDialog.chbShowObstacles.text=Show Obstacles
SettingsDialog.chbShowTargets.text=Show Targets SettingsDialog.chbShowTargets.text=Show Targets
...@@ -269,7 +271,8 @@ LoadingDialog.title=Loading... ...@@ -269,7 +271,8 @@ LoadingDialog.title=Loading...
FileDialog.filenamePrefix=vadere_ FileDialog.filenamePrefix=vadere_
SettingsDialog.title=Settings SettingsDialog.title=Settings
SettingsDialog.colors.border.text=Colors SettingsDialog.colors.border.text=Element coloring
SettingsDialog.pedcolors.border.text=Pedestrian coloring
SettingsDialog.additional.border.text=Additional SettingsDialog.additional.border.text=Additional
SettingsDialog.lblTarget.text=Target SettingsDialog.lblTarget.text=Target
#SettingsDialog.lblPedestrian.text=Pedestrian #SettingsDialog.lblPedestrian.text=Pedestrian
...@@ -284,7 +287,8 @@ SettingsDialog.btnClose.text=Close ...@@ -284,7 +287,8 @@ SettingsDialog.btnClose.text=Close
SettingsDialog.lblDensityColor.text=Density SettingsDialog.lblDensityColor.text=Density
SettingsDialog.lblAbsorbingAreaColor.text=Absorbing Area SettingsDialog.lblAbsorbingAreaColor.text=Absorbing Area
SettingsDialog.lblStair.text=Stair SettingsDialog.lblStair.text=Stair
SettingsDialog.lblPedestrianNoTarget.text=Without Target (-1) SettingsDialog.lblPedestrianNoTarget.text=Without Target
SettingsDialog.lblTargetColoring.text=Coloring by Target
ProjectView.menuOpenFloorFieldFile.title=Add Floor Field File... ProjectView.menuOpenFloorFieldFile.title=Add Floor Field File...
ProjectView.btnDrawVoronoiDiagram.tooltip=Draw and display a Voronoi Diagram ProjectView.btnDrawVoronoiDiagram.tooltip=Draw and display a Voronoi Diagram
......
...@@ -218,18 +218,20 @@ ProjectView.mntmCopyOutputDir.text=Kopiere Output Pfad in Zwischenablage ...@@ -218,18 +218,20 @@ ProjectView.mntmCopyOutputDir.text=Kopiere Output Pfad in Zwischenablage
SettingsDialog.chbShowPedestrianIds.text=Fu\u00dfg\u00E4nger-Ids anzeigen SettingsDialog.chbShowPedestrianIds.text=Fu\u00dfg\u00E4nger-Ids anzeigen
PostVis.additional.border.text=PostVis PostVis.additional.border.text=PostVis
PostVis.chShowEvacTimeColor.text=F\u00e4rbe Fu\u00dfg\u00E4nger nach ihrer Evakuierungszeit PostVis.chShowEvacTimeColor.text=F\u00e4rbe nach Evakuierungszeit
PostVis.chShowCriteriaColor.text=F\u00e4rbung nach Bedingung
PostVis.btnPlay.tooltip=Start (Leertaste) PostVis.btnPlay.tooltip=Start (Leertaste)
PostVis.btnPause.tooltip=Pause (Leertaste) PostVis.btnPause.tooltip=Pause (Leertaste)
PostVis.btnStop.tooltip=Stopp (Backspace-Taste) PostVis.btnStop.tooltip=Stopp (Backspace-Taste)
PostVis.btnRecord.tooltip=Starte Aufnahme PostVis.btnRecord.tooltip=Starte Aufnahme
PostVis.chbHidePedAtTarget.text=Fu\u00dfg\u00E4nger im Ziel nicht anzeigen PostVis.chbHidePedAtTarget.text=Verschwundene Fu\u00dfg\u00E4nger im Ziel nicht anzeigen
PostVis.chbHideTrajAtTarget.text=Trajektorien am Ziel nicht anzeigen PostVis.chbHideTrajAtTarget.text=Verschwundene Trajektorien am Ziel nicht anzeigen
PostVis.chbCleanSnapshot.text=Trajektorien auf Snapshots nicht anzeigen PostVis.chbCleanSnapshot.text=Trajektorien auf Snapshots nicht anzeigen
PostVis.chShowAllTrajOnSnapshot.text=Alle Trajektorien auf Snapshot anzeigen PostVis.chShowAllTrajOnSnapshot.text=Alle Trajektorien auf Snapshot anzeigen
SettingsDialog.chbUseRandomColors.text=Zuf\u00E4llige Farben SettingsDialog.chbUseRandomColors.text=Zuf\u00E4llige Farben
SettingsDialog.chbGroupColors.text=F\u00E4rbung nach Gruppe
SettingsDialog.chbHideVoronoiDiagram.text=Voronoi-Diagramm nicht anzeigen SettingsDialog.chbHideVoronoiDiagram.text=Voronoi-Diagramm nicht anzeigen
SettingsDialog.chbShowObstacles.text=Hindernisse anzeigen SettingsDialog.chbShowObstacles.text=Hindernisse anzeigen
SettingsDialog.chbShowTargets.text=Ziele anzeigen SettingsDialog.chbShowTargets.text=Ziele anzeigen
...@@ -264,7 +266,8 @@ LoadingDialog.title=Lade... ...@@ -264,7 +266,8 @@ LoadingDialog.title=Lade...
FileDialog.filenamePrefix=vadere_ FileDialog.filenamePrefix=vadere_
SettingsDialog.title=Einstellungen SettingsDialog.title=Einstellungen
SettingsDialog.colors.border.text=Farben SettingsDialog.colors.border.text=Elementfarben
SettingsDialog.pedcolors.border.text=Fu\u00dfg\u00e4ngerfarben
SettingsDialog.additional.border.text=Extras SettingsDialog.additional.border.text=Extras
SettingsDialog.lblTarget.text=Ziel SettingsDialog.lblTarget.text=Ziel
SettingsDialog.lblPedestrian.text=Pedestrian SettingsDialog.lblPedestrian.text=Pedestrian
...@@ -279,7 +282,8 @@ SettingsDialog.btnClose.text=Schlie\u00dfen ...@@ -279,7 +282,8 @@ SettingsDialog.btnClose.text=Schlie\u00dfen
SettingsDialog.lblDensityColor.text=Dichte SettingsDialog.lblDensityColor.text=Dichte
SettingsDialog.lblAbsorbingAreaColor.text=Absorbierender Bereich SettingsDialog.lblAbsorbingAreaColor.text=Absorbierender Bereich
SettingsDialog.lblStair.text=Treppe SettingsDialog.lblStair.text=Treppe
SettingsDialog.lblPedestrianNoTarget.text=Ohne Ziel (-1) SettingsDialog.lblPedestrianNoTarget.text=Ohne Ziel
SettingsDialog.lblTargetColoring.text=F\u00e4rbung nach Ziel
SettingsDialog.menuOpenFloorFieldFile.title=Floor Field-Datei hinzuf\u00fcgen... SettingsDialog.menuOpenFloorFieldFile.title=Floor Field-Datei hinzuf\u00fcgen...
SettingsDialog.btnDrawVoronoiDiagram.tooltip=Voronoi-Diagramm zeichnen und anzeigen SettingsDialog.btnDrawVoronoiDiagram.tooltip=Voronoi-Diagramm zeichnen und anzeigen
SettingsDialog.chbLogo.text=VADERE-Logo anzeigen SettingsDialog.chbLogo.text=VADERE-Logo anzeigen
......
...@@ -19,7 +19,7 @@ public abstract class ActionSetColor extends ActionVisualization { ...@@ -19,7 +19,7 @@ public abstract class ActionSetColor extends ActionVisualization {
@Override @Override
public void actionPerformed(final ActionEvent event) { public void actionPerformed(final ActionEvent event) {
Color color = JColorChooser.showDialog(null, "Choose Color", coloredPanel.getBackground()); Color color = JColorChooser.showDialog(coloredPanel.getParent(), "Choose Color", coloredPanel.getBackground());
if (color != null) { if (color != null) {
coloredPanel.setBackground(color); coloredPanel.setBackground(color);
saveColor(color); saveColor(color);
......
...@@ -13,18 +13,20 @@ public class ActionSetSnapshotDirectory extends ActionVisualization { ...@@ -13,18 +13,20 @@ public class ActionSetSnapshotDirectory extends ActionVisualization {
private static final Configuration CONFIG = VadereConfig.getConfig(); private static final Configuration CONFIG = VadereConfig.getConfig();
private final JTextField textField; private final JTextField textField;
private final JDialog parent;
public ActionSetSnapshotDirectory(final String name, final SimulationModel<? extends DefaultSimulationConfig> model, public ActionSetSnapshotDirectory(final String name, final SimulationModel<? extends DefaultSimulationConfig> model,
final JTextField textField) { final JTextField textField, final JDialog parent) {
super(name, model); super(name, model);
this.textField = textField; this.textField = textField;
this.parent = parent;
} }
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
final JFileChooser fc = new JFileChooser(CONFIG.getString("SettingsDialog.snapshotDirectory.path")); final JFileChooser fc = new JFileChooser(CONFIG.getString("SettingsDialog.snapshotDirectory.path"));
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
int returnVal = fc.showOpenDialog(null); int returnVal = fc.showOpenDialog(parent);
if (returnVal == JFileChooser.APPROVE_OPTION) { if (returnVal == JFileChooser.APPROVE_OPTION) {
File file = fc.getSelectedFile(); File file = fc.getSelectedFile();
......
package org.vadere.gui.components.model;
public enum AgentColoring {
TARGET, RANDOM, GROUP, EVACUATION_TIMES, PREDICATE;
}
...@@ -174,36 +174,36 @@ public abstract class DefaultModel<T extends DefaultConfig> extends Observable i ...@@ -174,36 +174,36 @@ public abstract class DefaultModel<T extends DefaultConfig> extends Observable i
return hasChanged; return hasChanged;
} }
protected void notifyViewportListeners(final ViewportChangeEvent event) { protected synchronized void notifyViewportListeners(final ViewportChangeEvent event) {
for (IViewportChangeListener listener : viewportChangeListeners) { for (IViewportChangeListener listener : viewportChangeListeners) {
listener.viewportChange(event); listener.viewportChange(event);
} }
} }
@Override @Override
public void notifyScaleListeners() { public synchronized void notifyScaleListeners() {
for (IScaleChangeListener listener : scaleChangeListeners) { for (IScaleChangeListener listener : scaleChangeListeners) {
listener.scaleChange(getScaleFactor()); listener.scaleChange(getScaleFactor());
} }
} }
@Override @Override
public void addViewportChangeListener(final IViewportChangeListener listener) { public synchronized void addViewportChangeListener(final IViewportChangeListener listener) {
viewportChangeListeners.add(listener); viewportChangeListeners.add(listener);
} }
@Override @Override
public void removeViewportChangeListener(final IViewportChangeListener listener) { public synchronized void removeViewportChangeListener(final IViewportChangeListener listener) {
viewportChangeListeners.remove(listener); viewportChangeListeners.remove(listener);
} }
@Override @Override
public void addScaleChangeListener(final IScaleChangeListener listener) { public synchronized void addScaleChangeListener(final IScaleChangeListener listener) {
this.scaleChangeListeners.add(listener); this.scaleChangeListeners.add(listener);
} }
@Override @Override
public void removeScaleChangeListener(final IScaleChangeListener listener) { public synchronized void removeScaleChangeListener(final IScaleChangeListener listener) {
this.scaleChangeListeners.remove(listener); this.scaleChangeListeners.remove(listener);
} }
...@@ -236,7 +236,7 @@ public abstract class DefaultModel<T extends DefaultConfig> extends Observable i ...@@ -236,7 +236,7 @@ public abstract class DefaultModel<T extends DefaultConfig> extends Observable i
*/ */
@Override @Override
public void setMousePosition(final Point mousePosition) { public synchronized void setMousePosition(final Point mousePosition) {
// this is needed cause of the mirrowing! // this is needed cause of the mirrowing!
VPoint mouseWorldPosition = pixelToWorld(new VPoint(mousePosition.x, mousePosition.y)); VPoint mouseWorldPosition = pixelToWorld(new VPoint(mousePosition.x, mousePosition.y));
double factor = Math.max(10, 1 / getGridResolution()); double factor = Math.max(10, 1 / getGridResolution());
...@@ -246,7 +246,7 @@ public abstract class DefaultModel<T extends DefaultConfig> extends Observable i ...@@ -246,7 +246,7 @@ public abstract class DefaultModel<T extends DefaultConfig> extends Observable i
} }
@Override @Override
public void setStartSelectionPoint(final Point startSelectionPoint) { public synchronized void setStartSelectionPoint(final Point startSelectionPoint) {
VPoint worldPosition = pixelToWorld(new VPoint(startSelectionPoint.x, startSelectionPoint.y)); VPoint worldPosition = pixelToWorld(new VPoint(startSelectionPoint.x, startSelectionPoint.y));
double factor = Math.max(10, 1 / getGridResolution()); double factor = Math.max(10, 1 / getGridResolution());
this.startSelectionPoint = new VPoint((Math.round(worldPosition.x * factor)) / factor, this.startSelectionPoint = new VPoint((Math.round(worldPosition.x * factor)) / factor,
...@@ -255,13 +255,13 @@ public abstract class DefaultModel<T extends DefaultConfig> extends Observable i ...@@ -255,13 +255,13 @@ public abstract class DefaultModel<T extends DefaultConfig> extends Observable i
} }
@Override @Override
public void setSelectionShape(final VShape shape) { public synchronized void setSelectionShape(final VShape shape) {
selectionShape = shape; selectionShape = shape;
setChanged(); setChanged();
} }
@Override @Override
public void fireChangeViewportEvent(final Rectangle2D.Double viewportBound) { public synchronized void fireChangeViewportEvent(final Rectangle2D.Double viewportBound) {
notifyViewportListeners(new ViewportChangeEvent(viewportBound)); notifyViewportListeners(new ViewportChangeEvent(viewportBound));
} }
...@@ -343,7 +343,7 @@ public abstract class DefaultModel<T extends DefaultConfig> extends Observable i ...@@ -343,7 +343,7 @@ public abstract class DefaultModel<T extends DefaultConfig> extends Observable i
} }
@Override @Override
public void setVoronoiDiagram(final VoronoiDiagram voronoiDiagram) { public synchronized void setVoronoiDiagram(final VoronoiDiagram voronoiDiagram) {
this.voronoiDiagram = voronoiDiagram; this.voronoiDiagram = voronoiDiagram;
} }
...@@ -382,7 +382,7 @@ public abstract class DefaultModel<T extends DefaultConfig> extends Observable i ...@@ -382,7 +382,7 @@ public abstract class DefaultModel<T extends DefaultConfig> extends Observable i
} }
@Override @Override
public void setWindowBound(final Rectangle2D.Double windowBound) { public synchronized void setWindowBound(final Rectangle2D.Double windowBound) {
this.windowBound = windowBound; this.windowBound = windowBound;
setChanged(); setChanged();
} }
...@@ -393,18 +393,18 @@ public abstract class DefaultModel<T extends DefaultConfig> extends Observable i ...@@ -393,18 +393,18 @@ public abstract class DefaultModel<T extends DefaultConfig> extends Observable i
return selectedElement; return selectedElement;
} }
private Optional<ScenarioElement> getElementsByPosition(final VPoint position) { private synchronized Optional<ScenarioElement> getElementsByPosition(final VPoint position) {
return getElements(e -> e.getShape().intersects(new Rectangle2D.Double(position.x - 0.1, position.y - 0.1, 0.2, 0.2))).findFirst(); return getElements(e -> e.getShape().intersects(new Rectangle2D.Double(position.x - 0.1, position.y - 0.1, 0.2, 0.2))).findFirst();
} }
protected ScenarioElement getClickedElement(final VPoint position) { protected synchronized ScenarioElement getClickedElement(final VPoint position) {
Optional<ScenarioElement> optional = getElementsByPosition(position); Optional<ScenarioElement> optional = getElementsByPosition(position);
if (optional.isPresent()) if (optional.isPresent())
return optional.get(); return optional.get();
return null; return null;
} }
protected Stream<ScenarioElement> getElements(final Predicate<ScenarioElement> predicate) { protected synchronized Stream<ScenarioElement> getElements(final Predicate<ScenarioElement> predicate) {
return StreamSupport.stream(this.spliterator(), false).filter(predicate); return StreamSupport.stream(this.spliterator(), false).filter(predicate);
} }
...@@ -430,12 +430,12 @@ public abstract class DefaultModel<T extends DefaultConfig> extends Observable i ...@@ -430,12 +430,12 @@ public abstract class DefaultModel<T extends DefaultConfig> extends Observable i
} }
@Override @Override
public void addSelectScenarioElementListener(final ISelectScenarioElementListener listener) { public synchronized void addSelectScenarioElementListener(final ISelectScenarioElementListener listener) {
this.selectScenarioElementListener.add(listener); this.selectScenarioElementListener.add(listener);
} }
@Override @Override
public void removeSelectScenarioElementListener(final ISelectScenarioElementListener listener) { public synchronized void removeSelectScenarioElementListener(final ISelectScenarioElementListener listener) {
this.selectScenarioElementListener.remove(listener); this.selectScenarioElementListener.remove(listener);
} }
...@@ -454,13 +454,13 @@ public abstract class DefaultModel<T extends DefaultConfig> extends Observable i ...@@ -454,13 +454,13 @@ public abstract class DefaultModel<T extends DefaultConfig> extends Observable i
setChanged(); setChanged();
} }
protected void notifySelectSecenarioElementListener(final ScenarioElement scenarioElement) { protected synchronized void notifySelectSecenarioElementListener(final ScenarioElement scenarioElement) {
for (ISelectScenarioElementListener listener : selectScenarioElementListener) { for (ISelectScenarioElementListener listener : selectScenarioElementListener) {
listener.selectionChange(scenarioElement); listener.selectionChange(scenarioElement);
} }
} }
protected void calculateScaleFactor() { protected synchronized void calculateScaleFactor() {
scaleFactor = Math.min(getWindowBound().getWidth() / getViewportBound().getWidth(), scaleFactor = Math.min(getWindowBound().getWidth() / getViewportBound().getWidth(),
getWindowBound().getHeight() / getViewportBound().getHeight()); getWindowBound().getHeight() / getViewportBound().getHeight());
} }
...@@ -470,7 +470,7 @@ public abstract class DefaultModel<T extends DefaultConfig> extends Observable i ...@@ -470,7 +470,7 @@ public abstract class DefaultModel<T extends DefaultConfig> extends Observable i
* @param pInPixel the mouse position of the mouse event * @param pInPixel the mouse position of the mouse event
* @return * @return
*/ */
protected VPoint pixelToWorld(final VPoint pInPixel) { protected synchronized VPoint pixelToWorld(final VPoint pInPixel) {
if(pInPixel != null) { if(pInPixel != null) {
return new VPoint(pInPixel.getX() / scaleFactor + getTopographyBound().getMinX(), return new VPoint(pInPixel.getX() / scaleFactor + getTopographyBound().getMinX(),
getTopographyBound().getMinY() + (getTopographyBound().getHeight() * scaleFactor - pInPixel.getY()) / scaleFactor); getTopographyBound().getMinY() + (getTopographyBound().getHeight() * scaleFactor - pInPixel.getY()) / scaleFactor);
......
...@@ -20,7 +20,6 @@ public class DefaultSimulationConfig extends DefaultConfig { ...@@ -20,7 +20,6 @@ public class DefaultSimulationConfig extends DefaultConfig {
private double densityStandardDerivation = CONFIG.getDouble("Density.standardDeviation"); private double densityStandardDerivation = CONFIG.getDouble("Density.standardDeviation");
private double pedestrianTorso = CONFIG.getDouble("Pedestrian.radius") * 2; private double pedestrianTorso = CONFIG.getDouble("Pedestrian.radius") * 2;
private boolean useRandomPedestrianColors = false;
private boolean showPedestrianIds = false; private boolean showPedestrianIds = false;
private boolean showTargets = true; private boolean showTargets = true;
private boolean showAbsorbingAreas = true; private boolean showAbsorbingAreas = true;
...@@ -43,6 +42,7 @@ public class DefaultSimulationConfig extends DefaultConfig { ...@@ -43,6 +42,7 @@ public class DefaultSimulationConfig extends DefaultConfig {
private double gridWidth = CONFIG.getDouble("ProjectView.cellWidth"); private double gridWidth = CONFIG.getDouble("ProjectView.cellWidth");
private final double MIN_CELL_WIDTH = CONFIG.getDouble("ProjectView.minCellWidth"); private final double MIN_CELL_WIDTH = CONFIG.getDouble("ProjectView.minCellWidth");
private final double MAX_CELL_WIDTH = CONFIG.getDouble("ProjectView.maxCellWidth"); private final double MAX_CELL_WIDTH = CONFIG.getDouble("ProjectView.maxCellWidth");
private AgentColoring agentColoring = AgentColoring.TARGET;
public DefaultSimulationConfig() { public DefaultSimulationConfig() {
super(); super();
...@@ -71,6 +71,7 @@ public class DefaultSimulationConfig extends DefaultConfig { ...@@ -71,6 +71,7 @@ public class DefaultSimulationConfig extends DefaultConfig {
this.showGroups = config.showGroups; this.showGroups = config.showGroups;
this.showPotentialField = config.showPotentialField; this.showPotentialField = config.showPotentialField;
this.showTargetPotentielFieldMesh = config.showTargetPotentielFieldMesh; this.showTargetPotentielFieldMesh = config.showTargetPotentielFieldMesh;
this.agentColoring = config.agentColoring;
} }
public boolean isShowGroups() { public boolean isShowGroups() {
...@@ -262,6 +263,17 @@ public class DefaultSimulationConfig extends DefaultConfig { ...@@ -262,6 +263,17 @@ public class DefaultSimulationConfig extends DefaultConfig {
} }
} }
public void setAgentColoring(final AgentColoring agentColoring) {
if(agentColoring != this.agentColoring) {
this.agentColoring = agentColoring;
setChanged();
}
}
public AgentColoring getAgentColoring() {
return agentColoring;
}
public void clearRandomColors() { public void clearRandomColors() {
randomColors.clear(); randomColors.clear();
} }
...@@ -273,14 +285,6 @@ public class DefaultSimulationConfig extends DefaultConfig { ...@@ -273,14 +285,6 @@ public class DefaultSimulationConfig extends DefaultConfig {
return randomColors.get(pedId); return randomColors.get(pedId);
} }
public void setUseRandomPedestrianColors(final boolean useRandomPedestrianColors) {
this.useRandomPedestrianColors = useRandomPedestrianColors;
}
public boolean isUseRandomPedestrianColors() {
return useRandomPedestrianColors;
}
public void setGridWidth(double gridWidth) { public void setGridWidth(double gridWidth) {
this.gridWidth = gridWidth; this.gridWidth = gridWidth;
} }
...@@ -305,4 +309,8 @@ public class DefaultSimulationConfig extends DefaultConfig { ...@@ -305,4 +309,8 @@ public class DefaultSimulationConfig extends DefaultConfig {
this.showPedestrianIds = showPedestrianIds; this.showPedestrianIds = showPedestrianIds;
} }
public boolean isShowFaydedPedestrians() {
return false;
}
} }
package org.vadere.gui.components.model; package org.vadere.gui.components.model;
import java.awt.*;
import java.util.Collection; import java.util.Collection;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function; import java.util.function.Function;
import org.jetbrains.annotations.NotNull;
import org.vadere.meshing.mesh.gen.PMesh; import org.vadere.meshing.mesh.gen.PMesh;
import org.vadere.meshing.mesh.inter.IMesh; import org.vadere.meshing.mesh.inter.IMesh;
import org.vadere.state.scenario.Agent; import org.vadere.state.scenario.Agent;
import org.vadere.state.scenario.Pedestrian;
import org.vadere.util.geometry.shapes.IPoint; import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.geometry.shapes.VRectangle; import org.vadere.util.geometry.shapes.VRectangle;
public abstract class SimulationModel<T extends DefaultSimulationConfig> extends DefaultModel { public abstract class SimulationModel<T extends DefaultSimulationConfig> extends DefaultModel {
public final T config; public final T config;
private ConcurrentHashMap<Integer, Color> colorMap;
private Random random;
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public SimulationModel(final T config) { public SimulationModel(final T config) {
super(config); super(config);
this.config = config; this.config = config;
this.colorMap = new ConcurrentHashMap<>();
this.colorMap.put(-1, config.getPedestrianDefaultColor());
this.random = new Random();
} }
public abstract Collection<Agent> getAgents(); public abstract Collection<Agent> getAgents();
...@@ -43,6 +53,8 @@ public abstract class SimulationModel<T extends DefaultSimulationConfig> extends ...@@ -43,6 +53,8 @@ public abstract class SimulationModel<T extends DefaultSimulationConfig> extends
return new PMesh(); return new PMesh();
} }
public abstract void setAgentColoring(@NotNull final AgentColoring agentColoring);
/*public double getPotential(final int x, final int y) { /*public double getPotential(final int x, final int y) {
double result = 0.0;