Commit f6ed88b6 authored by TLauster's avatar TLauster
Browse files

post merge cleanup

parent 57c76294
Pipeline #64302 failed with stages
in 44 seconds
......@@ -5,13 +5,7 @@ import org.vadere.simulator.models.DynamicElementFactory;
import org.vadere.state.attributes.scenario.AttributesAgent;
import org.vadere.state.attributes.scenario.AttributesDynamicElement;
import org.vadere.state.attributes.scenario.AttributesSource;
import org.vadere.state.scenario.Agent;
import org.vadere.state.scenario.Car;
import org.vadere.state.scenario.DistributionFactory;
import org.vadere.state.scenario.DynamicElement;
import org.vadere.state.scenario.Pedestrian;
import org.vadere.state.scenario.Source;
import org.vadere.state.scenario.Topography;
import org.vadere.state.scenario.*;
import org.vadere.state.util.SpawnArray;
import org.vadere.util.geometry.LinkedCellsGrid;
import org.vadere.util.geometry.shapes.VCircle;
......@@ -31,16 +25,8 @@ public abstract class SourceController {
private final DynamicElementFactory dynamicElementFactory;
private final Topography topography;
protected final Random random;
private final AttributesSource sourceAttributes;
private AttributesDynamicElement attributesDynamicElement;
private TargetDistribution targetDistribution = new TargetDistribution();
  • Erzeuge TargetDistribution im Construcor und über das Random object als final

    //im Construktur
    this.targetDistribution = new TargetDistribution(random);
Please register or sign in to reply
// TODO [priority=high] [task=refactoring] remove this from the SourceController and add a new attribute.
// This is ONLY used for "useFreeSpaceOnly".
private VCircle dynamicElementShape;
private int dynamicElementsToCreate;
private int dynamicElementsCreatedTotal;
/** <code>null</code>, if there is no next event. */
protected Double timeOfNextEvent;
......
......@@ -24,10 +24,11 @@ import java.util.concurrent.BlockingQueue;
public class VadereAutomation {
//public static final String SCENARIO_NAME = "Kreuzung3_Unit";
private static final String SCENARIO_NAME = "Kreuzung_softShell_one_source";
//private static final String SCENARIO_NAME = "Kreuzung_softShell_one_source";
private static final String SCENARIO_NAME = "LangerGang_3";
private static final String SCENARIO_PATH = "C:/Studium/BA/vadereProjects/";
private static final int N_SIMULATIONS = 10;
private static final int N_CONCURENT_SIMULATIONS = 9; //if this is choosen too high, out of memory errors may occur
private static final int N_CONCURENT_SIMULATIONS = 20; //if this is choosen too high, out of memory errors may occur
private static Scenario final_scenario;
private static ArrayList<Thread> arrThreads = new ArrayList<>();
......@@ -97,17 +98,17 @@ public class VadereAutomation {
ScenarioBuilder builder = new ScenarioBuilder(scenario);
scenario = builder.build();
List<Source> sources = scenario.getScenarioStore().topography.getSources();
List<Source> sources = scenario.getScenarioStore().getTopography().getSources();
int targetSize = scenario.getScenarioStore().getTopography().getTargets().size();
for (Source source : sources) {
List<List<Integer>> targetIds = new ArrayList<>();
List<Double> probabilities = new ArrayList<>();
int targetSize = scenario.getScenarioStore().topography.getTargets().size();
double probabilitiesSum = 0.;
//iterate over all available targets
for (int i = 0; i < targetSize; i++) {
targetIds.add(Collections.singletonList(scenario.getScenarioStore().topography.getTargets().get(i).getId()));
targetIds.add(Collections.singletonList(scenario.getScenarioStore().getTopography().getTargets().get(i).getId()));
double randomDouble = nextExponentialDouble();
probabilities.add(randomDouble);
......
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