Currently job artifacts in CI/CD pipelines on LRZ GitLab never expire. Starting from Wed 26.1.2022 the default expiration time will be 30 days (GitLab default). Currently existing 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 7fcdf2ed authored by Daniel Lehmberg's avatar Daniel Lehmberg
Browse files

initial code for new processor

parent 6c75b16b
Pipeline #113098 passed with stages
in 139 minutes and 19 seconds
package org.vadere.simulator.projects.dataprocessing.processor;
import org.vadere.simulator.control.SimulationState;
import org.vadere.simulator.projects.dataprocessing.datakey.TimestepKey;
import org.vadere.state.attributes.processor.AttributesAreaDensityCountingProcessor;
import org.vadere.state.attributes.processor.AttributesProcessor;
import org.vadere.state.scenario.Pedestrian;
import java.util.Collection;
import org.vadere.annotation.factories.dataprocessors.DataProcessorClass;
/**
* @author Daniel Lehmberg
* Processor counts number of pedestrians in a measurement area of any shape.
*/
@DataProcessorClass(label = "AreaDensityCountingProcessor")
public class AreaDensityCountingProcessor extends AreaDataProcessor<Integer> {
public AreaDensityCountingProcessor() {
super("areaDensityCounting");
setAttributes(new AttributesAreaDensityCountingProcessor());
}
@Override
protected void doUpdate(final SimulationState state) {
int step = state.getStep();
int pedCount = 0;
Collection<Pedestrian> pedestrians = state.getTopography().getPedestrianDynamicElements().getElements();
for (Pedestrian p : pedestrians) {
if(this.getMeasurementArea().getShape().contains(p.getPosition())){
pedCount++;
}
}
this.putValue(new TimestepKey(step), pedCount);
}
@Override
public AttributesProcessor getAttributes() {
if(super.getAttributes() == null) {
setAttributes(new AttributesAreaDensityCountingProcessor());
}
return super.getAttributes();
}
}
package org.vadere.state.attributes.processor;
/**
* @author Daniel Lehmberg
*/
public class AttributesAreaDensityCountingProcessor extends AttributesAreaProcessor {
}
......@@ -2,6 +2,7 @@ package org.vadere.state.attributes.processor;
/**
* @author Mario Teixeira Parente
* @author Stefan Schuhbäck (major update)
*/
public class AttributesAreaProcessor extends AttributesProcessor {
......
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