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 ea50b355 authored by Daniel Lehmberg's avatar Daniel Lehmberg
Browse files

Merge branch 'useFreeSpaceOnly' into 'master'

Reactive useFreeSpaceOnly=True again, closes #109

Closes #109

See merge request !35
parents f185711d dd4e7f91
Pipeline #77139 failed with stages
in 105 minutes and 28 seconds
......@@ -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);
}
}
......
......@@ -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