Skip to content

Commit

Permalink
update case study b2 with debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobrehmann committed Jan 29, 2025
1 parent 4edf4ee commit b5eb20d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public LocationBasedParticipationModel(SplittableRandom rnd, EpisimConfigGroup e
if (episimConfig.getActivityHandling() == EpisimConfigGroup.ActivityHandling.duringContact)
throw new IllegalStateException("Participation model can only be used with activityHandling startOfDay");

if (episimConfig.getDistrictLevelRestrictions() != EpisimConfigGroup.DistrictLevelRestrictions.no) {
if (episimConfig.getDistrictLevelRestrictions() == EpisimConfigGroup.DistrictLevelRestrictions.no) {
throw new IllegalStateException("LocationBasedParticipationModel can only be used if location based restrictions are used");
}

Expand Down
8 changes: 8 additions & 0 deletions src/main/java/org/matsim/run/batch/JRCaseStudyB2.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
public class JRCaseStudyB2 implements BatchRun<JRCaseStudyB2.Params> {


boolean DEBUG = true;
int runCounter = 0;

@Override
public SnzBerlinProductionScenario getBindings(int id, @Nullable Params params) {
return new SnzBerlinProductionScenario.Builder()
Expand All @@ -49,6 +52,11 @@ public Metadata getMetadata() {
@Override
public Config prepareConfig(int id, Params params) {

if (DEBUG & runCounter == 1) {
return null;
} else if(DEBUG)
runCounter++;

SnzBerlinProductionScenario module = getBindings(id, params);

// global config
Expand Down

0 comments on commit b5eb20d

Please sign in to comment.