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 640cf23c authored by Stefan Schuhbaeck's avatar Stefan Schuhbaeck
Browse files

remove quick fix and add move call to ODEModel

parent 98db5d98
......@@ -295,7 +295,6 @@ public class Simulation {
for (Model m : models) {
m.update(simTimeInSec);
}
topographyController.update(simTimeInSec); //rebuild CellGrid
if (topographyController.getTopography().hasTeleporter()) {
teleporterController.update(simTimeInSec);
......
......@@ -179,7 +179,10 @@ public abstract class ODEModel<T extends DynamicElement, TAttributes extends Att
equations.getVelocity(counter, y, newVelocity);
// set data to ped
VPoint oldPosition = element.getPosition();
setPosition(element, newPos);
topography.moveElement(element, oldPosition);
setVelocity(element, new Vector2D(newVelocity[0], newVelocity[1]));
counter++;
}
......
package org.vadere.state.scenario;
import org.vadere.util.geometry.shapes.VPoint;
public interface DynamicElementMover {
/**
* @param element the DynamicElement which was moved to a new position
* @param oldPosition the old potion the DynamicElement was prior to this call. (The new position is contained in the element)
*/
<T extends DynamicElement> void moveElement(T element, final VPoint oldPosition);
<T extends DynamicElement> void addElement(T element);
<T extends DynamicElement> void removeElement(T element);
}
......@@ -30,7 +30,7 @@ import org.vadere.util.geometry.shapes.VPolygon;
import org.vadere.util.geometry.shapes.VShape;
@JsonIgnoreProperties(value = {"allOtherAttributes", "obstacleDistanceFunction"})
public class Topography {
public class Topography implements DynamicElementMover{
/** Transient to prevent JSON serialization. */
private static Logger logger = Logger.getLogger(Topography.class);
......@@ -216,14 +216,17 @@ public class Topography {
return getContainer(elementType).getElement(id);
}
@Override
public <T extends DynamicElement> void addElement(T element) {
((DynamicElementContainer<T>) getContainer(element.getClass())).addElement(element);
}
@Override
public <T extends DynamicElement> void removeElement(T element) {
((DynamicElementContainer<T>) getContainer(element.getClass())).removeElement(element);
}
@Override
public <T extends DynamicElement> void moveElement(T element, final VPoint oldPosition) {
((DynamicElementContainer<T>) getContainer(element.getClass())).moveElement(element, oldPosition);
}
......
Markdown is supported
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