Commit 9ddb133d authored by Benedikt Zoennchen's avatar Benedikt Zoennchen
Browse files

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

parents 39b0d1f8 4680cc5a
......@@ -53,7 +53,7 @@ run_origin_test:
- Documentation/version-control/git-hook-vadere-software
- mvn clean
- mvn -Dmaven.test.skip=true package
- python3 Tools/VadereAnalysisTool/setup.py install --user
- python3 Tools/VadereAnalysisTools/VadereAnalysisTool/setup.py install --user
- python3 Tools/ContinuousIntegration/run_orign_translation_test.py
run_seed_test:
......@@ -63,7 +63,7 @@ run_seed_test:
- Documentation/version-control/git-hook-vadere-software
- mvn clean
- mvn -Dmaven.test.skip=true package
- python3 Tools/VadereAnalysisTool/setup.py install --user
- python3 Tools/VadereAnalysisTools/VadereAnalysisTool/setup.py install --user
- python3 Tools/ContinuousIntegration/run_seed_comparison_test.py
run_scenario_files:
......
......@@ -14,7 +14,7 @@ ScenarioChecker.source.targetIdNotFound=The following target ids where not found
ScenarioChecker.source.noTargetIdSet=No Target Ids set for Source.
ScenarioChecker.source.noTargetIdAndNoSpawn=No Target Ids set for Source with SpawnNumber 0. This might be an error.
ScenarioChecker.source.idNotUnique=Multiple Sources have the same ID.
ScenarioChecker.source.spawnAtRandomButNotAtFreeSpace=Combination isSpawnAtRandomPositions=true and isUseFreeSpaceOnly=false not allowed.
ScenarioChecker.source.spawnAtRandomButNotAtFreeSpace=Combination isSpawnAtRandomPositions=true and isUseFreeSpaceOnly=false can lead to illegal and undesired simulation states.
ScenarioChecker.source.toSmall=Source is to small
ScenarioChecker.source.spawnUseNotAtFreeSpace=useFreeSpaceOnly=false is Deprecated. Will be removed in future relases. Not all models can handle overlapping pedestrians.
ScenarioChecker.stairs.wrongTreadDim=Stair treadDepth outside of allowed dimension. Change the thread numbers to compensate.
......
......@@ -13,7 +13,7 @@ ScenarioChecker.type.processor.warning=Procesor Warnung
ScenarioChecker.source.targetIdNotFound=Die folgenden Ziel-IDs wurden nicht im Szenario gefunden.
ScenarioChecker.source.noTargetIdSet=In der Quelle wurden keine Ziel Ids vergeben.
ScenarioChecker.source.noTargetIdAndNoSpawn=In der Quelle wurden keine Ziel Ids vergeben, aber die Spawn Anzahl ist bei 0.
ScenarioChecker.source.spawnAtRandomButNotAtFreeSpace=Kombination aus isSpawnAtRandomPositions=true und isUseFreeSpaceOnly=false ist nicht erlaubt.
ScenarioChecker.source.spawnAtRandomButNotAtFreeSpace=Kombination aus isSpawnAtRandomPositions=true und isUseFreeSpaceOnly=false kann zu illegalen und unerwünschten Zuständen führen.
ScenarioChecker.source.toSmall=Quelle ist zu klein
ScenarioChecker.source.spawnUseNotAtFreeSpace=useFreeSpaceOnly=false ist Deprecated. Dieses Attribut wird in zuk\u00fcnfigen version entfernt. Nicht alle Modell k\u00f6nnen mit \u00fcberlappungen umgehen.
ScenarioChecker.source.idNotUnique=Quellen haben keine eindeutige ID.
......
......@@ -48,21 +48,18 @@ public class SingleSourceController extends SourceController {
if (sourceAttributes.isSpawnAtRandomPositions()) {
if (sourceAttributes.isUseFreeSpaceOnly()) {
spawnPoints = getRealRandomPositions(
numberToSpawn,
random,
getDynElementsAtSource().stream()
.map(PointPositioned::getPosition)
.map(dynamicElementFactory::getDynamicElementRequiredPlace)
.collect(Collectors.toList())
);
spawnPoints = getRealRandomPositions(
numberToSpawn,
random,
getDynElementsAtSource().stream()
.map(PointPositioned::getPosition)
.map(dynamicElementFactory::getDynamicElementRequiredPlace)
.collect(Collectors.toList())
);
numberToSpawn -= spawnPoints.size();
assert (numberToSpawn >= 0);
numberToSpawn -= spawnPoints.size();
assert (numberToSpawn >= 0);
} else {
throw new IllegalArgumentException("use random position without free space only makes no sense.");
}
} else {
......@@ -158,7 +155,8 @@ public class SingleSourceController extends SourceController {
}
// no intersection with other free spaces (obstacles & other pedestrians)
if (testFreeSpace(freeSpaceRequired, blockPedestrianShapes)) {
if (!sourceAttributes.isUseFreeSpaceOnly() || testFreeSpace(freeSpaceRequired, blockPedestrianShapes)) {
return Optional.of(randomPoint);
}
}
......
......@@ -56,7 +56,14 @@ public class VadereConsole {
.choices("OFF", "FATAL", "TOPOGRAPHY_ERROR", "TOPOGRAPHY_WARN", "INFO", "DEBUG", "ALL")
.setDefault("INFO")
.action(new SetLogLevelCommand())
.help("Set Log Level for vadere.");
.help("Set Log Level.");
parser.addArgument("--logname")
.required(false)
.type(String.class)
.dest("logname")
.action(new SetLogNameCommand())
.help("Write log to given file.");
}
private static void addSubCommandsToParser(ArgumentParser parser) {
......@@ -74,12 +81,12 @@ public class VadereConsole {
.required(true)
.type(String.class)
.dest("project-dir")
.help("Path to project directory");
.help("Path to project directory.");
projectRun.addArgument("--scenario-file", "-f")
.required(false)
.type(String.class)
.dest("scenario-file")
.help("Name of Scenario file");
.help("Name of Scenario file.");
projectRun.addArgument("--scenario-checker")
.required(false)
.type(String.class)
......@@ -91,7 +98,7 @@ public class VadereConsole {
// Run Scenario
Subparser scenarioRun = subparsers
.addParser(SubCommand.SCENARO_RUN.getCmdName())
.help("Run scenario without a project")
.help("Run scenario without a project.")
.setDefault("func", new ScenarioRunSubCommand());
scenarioRun.addArgument("--output-dir", "-o")
.required(false)
......@@ -110,7 +117,7 @@ public class VadereConsole {
.required(true)
.type(String.class)
.dest("scenario-file")
.help("Scenario file to run");
.help("Scenario file to run.");
scenarioRun.addArgument("--scenario-checker")
.required(false)
.type(String.class)
......@@ -136,7 +143,7 @@ public class VadereConsole {
.required(true)
.type(String.class)
.dest("scenario-file")
.help("Scenario files to run");
.help("Scenario files to run.");
// Run Migration Assistant
......@@ -176,7 +183,7 @@ public class VadereConsole {
.action(Arguments.storeTrue())
.dest("revert-migration")
.help("If set vadere will search for a <scenario-file>.legacy and will replace the current version with this backup." +
" The Backup must be in the same directory");
" The Backup must be in the same directory.");
migrationAssistant.addArgument("--recursive", "-r")
.required(false)
......@@ -184,7 +191,7 @@ public class VadereConsole {
.dest("recursive")
.setDefault(false)
.help("If PATH contains a directory instead of a scenario file recursively search " +
"the directory tree for scenario files and apply the command");
"the directory tree for scenario files and apply the command.");
migrationAssistant.addArgument("--create-new-version")
.required(false)
......@@ -192,7 +199,7 @@ public class VadereConsole {
.dest("create-new-version")
.help("Create new transformation and identity file based on current latest version" +
"PATH must point to the directory containing the old transformation files." +
" This Argument takes the new Version Label as input");
" This Argument takes the new Version Label as input.");
}
}
package org.vadere.simulator.entrypoints.cmd.commands;
import net.sourceforge.argparse4j.inf.Argument;
import net.sourceforge.argparse4j.inf.ArgumentAction;
import net.sourceforge.argparse4j.inf.ArgumentParser;
import net.sourceforge.argparse4j.inf.ArgumentParserException;
import org.apache.log4j.*;
import java.util.Map;
public class SetLogNameCommand implements ArgumentAction {
@Override
public void run(ArgumentParser parser, Argument arg, Map<String, Object> attrs, String flag, Object value) throws ArgumentParserException {
String filename = (String) value;
RollingFileAppender appender = new RollingFileAppender();
appender.setName(filename);
appender.setFile(filename);
appender.setAppend(false);
appender.setMaxFileSize("10000KB");
appender.setLayout(new PatternLayout("%d{ABSOLUTE} %5p [%t] %c{1}:%L - %m%n"));
appender.activateOptions();
Logger.getRootLogger().addAppender(appender);
}
@Override
public void onAttach(Argument arg) {
}
@Override
public boolean consumeArgument() {
return true;
}
}
......@@ -21,7 +21,7 @@ public class SourceSpawnSettingCheck extends AbstractScenarioCheck implements To
AttributesSource attr = source.getAttributes();
if (attr.isSpawnAtRandomPositions() && !attr.isUseFreeSpaceOnly()){
messages.add(msgBuilder.topographyError().target(source)
messages.add(msgBuilder.topographyWarning().target(source)
.reason(ScenarioCheckerReason.SOURCE_SPAWN_RND_POS_NOT_FREE_SPACE).build());
} else if (!attr.isUseFreeSpaceOnly()){
messages.add(msgBuilder.topographyWarning().target(source)
......
......@@ -73,11 +73,13 @@ public class Face {
}
}
double maxArea = (limits.xHigh - limits.xLow)
* (limits.yHigh - limits.yLow);
double maxArea = (limits.xHigh - limits.xLow) * (limits.yHigh - limits.yLow);
try {
if (result < 0 || (result > maxArea && Math.abs(result-maxArea) > 1E-15)) {
if(result > maxArea && Math.abs(result-maxArea) > 1E-13){
// Values of -3.68594044175552e-14 were observed
result = maxArea; // set to max area and continue silently...
}else if (result < 0 || (result > maxArea && Math.abs(result-maxArea) >= 1E-13)) {
String message = "(Object " + id + ") Area of face is: " + result + ". This is an illegal area size " +
"because result has to be positive and less than maxArea (= " + maxArea + ")";
throw new IllegalStateException(message);
......
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