Ejemplo n.º 1
0
  public static void main(String[] args) {
    Config config = ConfigUtils.createConfig();
    ConfigUtils.loadConfig(config, args[0]);
    final Controler controler = new Controler(ScenarioUtils.loadScenario(config));
    final WaitTimeStuckCalculator waitTimeCalculator =
        new WaitTimeStuckCalculator(
            controler.getScenario().getPopulation(),
            controler.getScenario().getTransitSchedule(),
            controler.getConfig().travelTimeCalculator().getTraveltimeBinSize(),
            (int)
                (controler.getConfig().qsim().getEndTime()
                    - controler.getConfig().qsim().getStartTime()));
    controler.getEvents().addHandler(waitTimeCalculator);
    final StopStopTimeCalculator stopStopTimeCalculator =
        new StopStopTimeCalculator(
            controler.getScenario().getTransitSchedule(),
            controler.getConfig().travelTimeCalculator().getTraveltimeBinSize(),
            (int)
                (controler.getConfig().qsim().getEndTime()
                    - controler.getConfig().qsim().getStartTime()));
    controler.getEvents().addHandler(stopStopTimeCalculator);
    final VehicleOccupancyCalculator vehicleOccupancyCalculator =
        new VehicleOccupancyCalculator(
            controler.getScenario().getTransitSchedule(),
            ((ScenarioImpl) controler.getScenario()).getTransitVehicles(),
            controler.getConfig().travelTimeCalculator().getTraveltimeBinSize(),
            (int)
                (controler.getConfig().qsim().getEndTime()
                    - controler.getConfig().qsim().getStartTime()));
    controler.getEvents().addHandler(vehicleOccupancyCalculator);
    controler.addOverridingModule(
        new AbstractModule() {
          @Override
          public void install() {
            bind(TransitRouter.class)
                .toProvider(
                    new TransitRouterEventsWSVFactory(
                        controler.getScenario(),
                        waitTimeCalculator.getWaitTimes(),
                        stopStopTimeCalculator.getStopStopTimes(),
                        vehicleOccupancyCalculator.getVehicleOccupancy()));
          }
        });

    // yyyyyy note that in the above script only the router is modified, but not the scoring.  With
    // standard matsim, a slower bu
    // less crowded pt route will only be accepted by the agent when the faster but more crowded
    // option was never presented
    // to the agent.  kai, jul'15

    controler.run();
  }
  void run() {

    if (!new File(outputDir + "/input/").exists()) {
      new File(outputDir + "/input/").mkdirs();
    }

    createTolledNetwork();
    createDemand();
    createConfig();
    Controler controler = new Controler(sc);

    if (isComparing) {
      TollHandler tollHandler = new TollHandler(sc);
      final TollDisutilityCalculatorFactory fact = new TollDisutilityCalculatorFactory(tollHandler);

      controler.addOverridingModule(
          new AbstractModule() {
            @Override
            public void install() {
              bindTravelDisutilityFactory().toInstance(fact);
            }
          });

      switch (congestionImpl) {
        case "implV3":
          controler.addControlerListener(
              new MarginalCongestionPricingContolerListener(
                  sc,
                  tollHandler,
                  new CongestionHandlerImplV3(controler.getEvents(), (ScenarioImpl) sc)));
          break;
        case "implV4":
          controler.addControlerListener(
              new MarginalCongestionPricingContolerListener(
                  sc, tollHandler, new CongestionHandlerImplV4(controler.getEvents(), sc)));
          break;
        case "implV6":
          //				controler.addControlerListener(new MarginalCongestionPricingContolerListener(sc,
          // tollHandler, new CongestionHandlerImplV6(controler.getEvents(),  sc)));
          break;
        default:
          break;
      }
    }
    controler.run();
  }
  /** @param args */
  public static void main(String[] args) {
    if (args == null) {
      // set a default config for convenience...
      args[0] = "examples/tutorial/programming/example7-config.xml";
    }

    Config config = ConfigUtils.loadConfig(args[0]);

    Scenario scenario = ScenarioUtils.loadScenario(config);

    // Create an instance of the controler
    Controler controler = new Controler(config);

    // add the events handlers
    controler.getEvents().addHandler(new MyEventHandler1());
    controler.getEvents().addHandler(new MyEventHandler2(500));
    controler.getEvents().addHandler(new MyEventHandler3());
    controler.getEvents().addHandler(new CongestionDetectionEventHandler(scenario.getNetwork()));

    // call run() to start the simulation
    controler.run();
  }
    @Override
    public void notifyIterationStarts(IterationStartsEvent event) {
      if (event.getIteration() == 0) {
        Controler controler = event.getControler();

        // initialize the social costs calculator
        SocialCostCalculatorV2 scc =
            new SocialCostCalculatorV2(
                controler.getScenario().getNetwork(),
                controler.getEvents(),
                controler.getLinkTravelTimes(),
                controler,
                blendFactor);

        controler.addControlerListener(scc);
        controler.getEvents().addHandler(scc);

        // initialize the social costs disutility calculator
        final SocialCostTravelDisutilityFactory factory =
            new SocialCostTravelDisutilityFactory(scc);
        controler.addOverridingModule(
            new AbstractModule() {
              @Override
              public void install() {
                bindCarTravelDisutilityFactory().toInstance(factory);
              }
            });

        // create a plot containing the mean travel times
        Set<String> transportModes = new HashSet<String>();
        transportModes.add(TransportMode.car);
        transportModes.add(TransportMode.pt);
        transportModes.add(TransportMode.walk);
        MeanTravelTimeCalculator mttc =
            new MeanTravelTimeCalculator(controler.getScenario(), transportModes);
        controler.addControlerListener(mttc);
        controler.getEvents().addHandler(mttc);
      }
    }
Ejemplo n.º 5
0
  /*
   * Just starts a randomized router.
   *
   */
  @Ignore
  @Test
  public final void test2() {

    String configFile1 = testUtils.getPackageInputDirectory() + "CNTest/config1.xml";
    Controler controler = new Controler(configFile1);
    TollHandler tollHandler = new TollHandler(controler.getScenario());

    final CongestionTollTimeDistanceTravelDisutilityFactory factory =
        new CongestionTollTimeDistanceTravelDisutilityFactory(
            new RandomizingTimeDistanceTravelDisutilityFactory(
                TransportMode.car, controler.getConfig().planCalcScore()),
            tollHandler,
            controler.getConfig().planCalcScore());
    factory.setSigma(3.);

    controler.addOverridingModule(
        new AbstractModule() {
          @Override
          public void install() {
            this.bindCarTravelDisutilityFactory().toInstance(factory);
          }
        });

    controler.addControlerListener(
        new MarginalCongestionPricingContolerListener(
            controler.getScenario(),
            tollHandler,
            new CongestionHandlerImplV3(controler.getEvents(), controler.getScenario())));
    controler.addOverridingModule(new OTFVisFileWriterModule());
    controler
        .getConfig()
        .controler()
        .setOverwriteFileSetting(
            OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists);
    controler.run();
  }
Ejemplo n.º 6
0
  public static void main(String[] args) {

    // loading and modifying the config:
    Config config;
    if (args.length > 0) {
      config = ConfigUtils.loadConfig(args[0]);
    } else {
      throw new RuntimeException("needs argument config.xml");
    }

    // request FEATHERS2 as a PlanStrategy (it is added to the controler further below):
    StrategySettings stratSets =
        new StrategySettings(ConfigUtils.createAvailableStrategyId(config));
    stratSets.setStrategyName(FEATHERS2);
    stratSets.setWeight(0.1);
    config.strategy().addStrategySettings(stratSets);

    // loading the scenario:
    final Scenario scenario = ScenarioUtils.loadScenario(config);

    // loading and modifying the controler:
    final Controler ctrl = new Controler(scenario);

    // generate the FEATHERS adapter class:
    final FeathersModule feathers2 = new FeathersModule();

    // make it an events handler (so it can listen to events; a different solution may be desired
    // here)
    ctrl.getEvents().addHandler(feathers2);

    // add it as a PlanStrategy:
    final javax.inject.Provider<PlanStrategy> planStrategyFactory =
        new javax.inject.Provider<PlanStrategy>() {
          @Override
          public PlanStrategy get() {
            PlanSelector<Plan, Person> planSelector = new RandomPlanSelector<>();
            PlanStrategyImpl.Builder builder = new PlanStrategyImpl.Builder(planSelector);
            PlanStrategyModule module =
                new PlanStrategyModule() {
                  @Override
                  public void prepareReplanning(ReplanningContext replanningContext) {}

                  @Override
                  public void handlePlan(Plan plan) {
                    // the following should (test!!!) only retain the plan we are looking at:
                    Person person = scenario.getPopulation().getPersons().get(plan.getPerson());
                    List<Plan> planToKeep = new ArrayList<>();
                    planToKeep.add(plan);
                    person.getPlans().retainAll(planToKeep);

                    PopulationFactory pf = scenario.getPopulation().getFactory();

                    // modify plan by feathers:
                    plan = feathers2.createPlan(plan.getPerson(), pf);
                  }

                  @Override
                  public void finishReplanning() {}
                };
            builder.addStrategyModule(module);
            return builder.build();
          }
        };
    ctrl.addOverridingModule(
        new AbstractModule() {
          @Override
          public void install() {
            addPlanStrategyBinding(FEATHERS2).toProvider(planStrategyFactory);
          }
        });

    // running the controler:
    ctrl.run();
  }
Ejemplo n.º 7
0
  /*
   * Tests if different travel disutility factories result in the same outcome.
   *
   */
  @Ignore
  @Test
  public final void test3() {

    String configFile1 = testUtils.getPackageInputDirectory() + "CNTest/config1.xml";

    // 1:

    Config config1 = ConfigUtils.loadConfig(configFile1);
    String outputDirectory1 = testUtils.getOutputDirectory() + "a";
    config1.controler().setOutputDirectory(outputDirectory1);

    Scenario scenario1 = ScenarioUtils.loadScenario(config1);
    Controler controler1 = new Controler(scenario1);

    TollHandler tollHandler1 = new TollHandler(scenario1);

    final CongestionTollTimeDistanceTravelDisutilityFactory factory1 =
        new CongestionTollTimeDistanceTravelDisutilityFactory(
            new RandomizingTimeDistanceTravelDisutilityFactory(
                TransportMode.car, config1.planCalcScore()),
            tollHandler1,
            config1.planCalcScore());
    factory1.setSigma(0.);
    factory1.setBlendFactor(0.1);

    controler1.addOverridingModule(
        new AbstractModule() {
          @Override
          public void install() {
            this.bindCarTravelDisutilityFactory().toInstance(factory1);
          }
        });

    controler1.addControlerListener(
        new MarginalCongestionPricingContolerListener(
            controler1.getScenario(),
            tollHandler1,
            new CongestionHandlerImplV3(controler1.getEvents(), controler1.getScenario())));
    controler1.addOverridingModule(new OTFVisFileWriterModule());
    controler1
        .getConfig()
        .controler()
        .setOverwriteFileSetting(
            OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists);
    controler1.run();

    // 2: "deprecated way"

    Config config2 = ConfigUtils.loadConfig(configFile1);
    String outputDirectory2 = testUtils.getOutputDirectory() + "b";
    config2.controler().setOutputDirectory(outputDirectory2);

    Scenario scenario2 = ScenarioUtils.loadScenario(config2);
    Controler controler2 = new Controler(scenario2);

    TollHandler tollHandler2 = new TollHandler(scenario2);

    final TollDisutilityCalculatorFactory factory2 =
        new TollDisutilityCalculatorFactory(tollHandler2, config2.planCalcScore());
    controler2.addOverridingModule(
        new AbstractModule() {
          @Override
          public void install() {
            bindCarTravelDisutilityFactory().toInstance(factory2);
          }
        });

    controler2.addControlerListener(
        new MarginalCongestionPricingContolerListener(
            controler2.getScenario(),
            tollHandler2,
            new CongestionHandlerImplV3(controler2.getEvents(), controler2.getScenario())));
    controler2.addOverridingModule(new OTFVisFileWriterModule());
    controler2
        .getConfig()
        .controler()
        .setOverwriteFileSetting(
            OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists);
    controler2.run();

    // compare

    LinkDemandEventHandler handler1 = analyzeEvents(outputDirectory1, configFile1); // a
    System.out.println("Bottleneck demand - (a): " + getBottleneckDemand(handler1)); // a

    LinkDemandEventHandler handler2 = analyzeEvents(outputDirectory2, configFile1); // b
    System.out.println("Bottleneck demand - (b): " + getBottleneckDemand(handler2)); // b

    Assert.assertEquals(
        "run a and b should result in the exact same outcome (without accounting for randomness!)",
        true,
        getBottleneckDemand(handler1) == getBottleneckDemand(handler2));
  }
Ejemplo n.º 8
0
  public static void main(String[] args) {
    Config config = ConfigUtils.createConfig();
    config.removeModule(StrategyConfigGroup.GROUP_NAME);
    config.addModule(new StrategyPopsConfigGroup());
    ConfigUtils.loadConfig(config, args[0]);
    controler = new Controler(ScenarioUtils.loadScenario(config));
    controler
        .getConfig()
        .controler()
        .setOverwriteFileSetting(
            true
                ? OutputDirectoryHierarchy.OverwriteFileSetting.overwriteExistingFiles
                : OutputDirectoryHierarchy.OverwriteFileSetting.failIfDirectoryExists);
    controler.addControlerListener(
        new LegHistogramListener(
            controler.getEvents(), true, controler.getScenario().getPopulation()));
    controler.addControlerListener(
        new ScoreStats(
            controler.getScenario().getPopulation(),
            ScoreStatsControlerListener.FILENAME_SCORESTATS,
            true));
    // services.addControlerListener(new CalibrationStatsListener(services.getEvents(), new
    // String[]{args[1], args[2]}, 1, "Travel Survey (Benchmark)", "Red_Scheme", new
    // HashSet<Id<Person>>()));
    final WaitTimeStuckCalculator waitTimeCalculator =
        new WaitTimeStuckCalculator(
            controler.getScenario().getPopulation(),
            controler.getScenario().getTransitSchedule(),
            controler.getConfig().travelTimeCalculator().getTraveltimeBinSize(),
            (int)
                (controler.getConfig().qsim().getEndTime()
                    - controler.getConfig().qsim().getStartTime()));
    controler.getEvents().addHandler(waitTimeCalculator);
    final StopStopTimeCalculator stopStopTimeCalculator =
        new StopStopTimeCalculator(
            controler.getScenario().getTransitSchedule(),
            controler.getConfig().travelTimeCalculator().getTraveltimeBinSize(),
            (int)
                (controler.getConfig().qsim().getEndTime()
                    - controler.getConfig().qsim().getStartTime()));
    controler.getEvents().addHandler(stopStopTimeCalculator);
    controler.addOverridingModule(
        new AbstractModule() {
          @Override
          public void install() {
            bind(TransitRouter.class)
                .toProvider(
                    new TransitRouterWSImplFactory(
                        controler.getScenario(),
                        waitTimeCalculator.getWaitTimes(),
                        stopStopTimeCalculator.getStopStopTimes()));
          }
        });
    controler.setScoringFunctionFactory(
        new CharyparNagelOpenTimesScoringFunctionFactory(
            controler.getConfig().planCalcScore(), controler.getScenario()));
    AbstractModule myStrategyManagerModule =
        new AbstractModule() {

          @Override
          public void install() {
            bind(StrategyManager.class).toInstance(myLoadStrategyManager());
          }
        };
    controler.addOverridingModule(myStrategyManagerModule);
    controler.run();
  }
Ejemplo n.º 9
0
 public static void main(String[] args) throws IOException, ClassNotFoundException {
   Config config = ConfigUtils.createConfig();
   ConfigUtils.loadConfig(config, args[0]);
   final Controler controler = new Controler(ScenarioUtils.loadScenario(config));
   if (args.length > 3) {
     final StopStopTimeCalculator stopStopTimeCalculatorEvents =
         new StopStopTimeCalculator(
             controler.getScenario().getTransitSchedule(),
             controler.getConfig().travelTimeCalculator().getTraveltimeBinSize(),
             (int)
                 (controler.getConfig().qsim().getEndTime()
                     - controler.getConfig().qsim().getStartTime()));
     stopStopTimeCalculatorEvents.setUseVehicleIds(false);
     EventsManager eventsManager = EventsUtils.createEventsManager(controler.getConfig());
     eventsManager.addHandler(stopStopTimeCalculatorEvents);
     (new MatsimEventsReader(eventsManager)).readFile(args[3]);
     controler.addOverridingModule(
         new AbstractModule() {
           @Override
           public void install() {
             bindMobsim()
                 .toProvider(
                     new Provider<Mobsim>() {
                       @Override
                       public Mobsim get() {
                         return new PTQSimFactory(stopStopTimeCalculatorEvents.getStopStopTimes())
                             .createMobsim(controler.getScenario(), controler.getEvents());
                       }
                     });
           }
         });
   } else
     controler.addOverridingModule(
         new AbstractModule() {
           @Override
           public void install() {
             bindMobsim()
                 .toProvider(
                     new Provider<Mobsim>() {
                       @Override
                       public Mobsim get() {
                         return new PTQSimFactory()
                             .createMobsim(controler.getScenario(), controler.getEvents());
                       }
                     });
           }
         });
   controler
       .getConfig()
       .controler()
       .setOverwriteFileSetting(
           true
               ? OutputDirectoryHierarchy.OverwriteFileSetting.overwriteExistingFiles
               : OutputDirectoryHierarchy.OverwriteFileSetting.failIfDirectoryExists);
   controler.addControlerListener(
       new CalibrationStatsListener(
           controler.getEvents(),
           new String[] {args[1], args[2]},
           1,
           "Travel Survey (Benchmark)",
           "Red_Scheme",
           new HashSet<Id<Person>>()));
   WaitTimeStuckCalculator waitTimeCalculator =
       new WaitTimeStuckCalculator(
           controler.getScenario().getPopulation(),
           controler.getScenario().getTransitSchedule(),
           controler.getConfig().travelTimeCalculator().getTraveltimeBinSize(),
           (int)
               (controler.getConfig().qsim().getEndTime()
                   - controler.getConfig().qsim().getStartTime()));
   controler.getEvents().addHandler(waitTimeCalculator);
   StopStopTimeCalculator stopStopTimeCalculator =
       new StopStopTimeCalculator(
           controler.getScenario().getTransitSchedule(),
           controler.getConfig().travelTimeCalculator().getTraveltimeBinSize(),
           (int)
               (controler.getConfig().qsim().getEndTime()
                   - controler.getConfig().qsim().getStartTime()));
   controler.getEvents().addHandler(stopStopTimeCalculator);
   final TransitRouterEventsWSFactory factory =
       new TransitRouterEventsWSFactory(
           controler.getScenario(),
           waitTimeCalculator.getWaitTimes(),
           stopStopTimeCalculator.getStopStopTimes());
   controler.addOverridingModule(
       new AbstractModule() {
         @Override
         public void install() {
           bind(TransitRouter.class).toProvider(factory);
         }
       });
   controler.run();
 }
  // test if the right number of money events are thrown
  @Test
  public final void test4() {

    String configFile =
        testUtils.getPackageInputDirectory() + "AdvancedMarginalCongestionPricingTest/config4.xml";

    Config config = ConfigUtils.loadConfig(configFile);
    config.plansCalcRoute().setInsertingAccessEgressWalk(false);

    final Scenario scenario = ScenarioUtils.loadScenario(config);
    Controler controler = new Controler(scenario);

    EventsManager events = controler.getEvents();

    final List<CongestionEvent> congestionEvents = new ArrayList<CongestionEvent>();
    final List<PersonMoneyEvent> moneyEvents = new ArrayList<PersonMoneyEvent>();

    events.addHandler(
        new CongestionEventHandler() {

          @Override
          public void reset(int iteration) {}

          @Override
          public void handleEvent(CongestionEvent event) {
            congestionEvents.add(event);
          }
        });

    events.addHandler(
        new PersonMoneyEventHandler() {

          @Override
          public void reset(int iteration) {}

          @Override
          public void handleEvent(PersonMoneyEvent event) {
            moneyEvents.add(event);
          }
        });

    final TollHandler tollHandler = new TollHandler(controler.getScenario());
    final TollDisutilityCalculatorFactory tollDisutilityCalculatorFactory =
        new TollDisutilityCalculatorFactory(tollHandler, controler.getConfig().planCalcScore());
    controler.addOverridingModule(
        new AbstractModule() {
          @Override
          public void install() {
            addControlerListenerBinding()
                .toProvider(
                    new Provider<ControlerListener>() {
                      @Inject Scenario scenario;
                      @Inject EventsManager eventsManager;

                      @Override
                      public ControlerListener get() {
                        return new AdvancedMarginalCongestionPricingContolerListener(
                            scenario,
                            tollHandler,
                            new CongestionHandlerImplV3(eventsManager, (MutableScenario) scenario));
                      }
                    });
            bindCarTravelDisutilityFactory().toInstance(tollDisutilityCalculatorFactory);
          }
        });
    controler.addOverridingModule(new OTFVisFileWriterModule());
    controler
        .getConfig()
        .controler()
        .setOverwriteFileSetting(
            OutputDirectoryHierarchy.OverwriteFileSetting.overwriteExistingFiles);
    controler.run();

    // test if there are three congestion events and three money events
    Assert.assertEquals("Wrong number of congestion events.", 3, congestionEvents.size());
    Assert.assertEquals("Wrong number of money events.", 3, moneyEvents.size());
  }
  // test if a delayed arrival at the last activity results in the right monetary amount
  @Test
  public final void test2() {

    String configFile =
        testUtils.getPackageInputDirectory() + "AdvancedMarginalCongestionPricingTest/config2.xml";

    Config config = ConfigUtils.loadConfig(configFile);
    config.plansCalcRoute().setInsertingAccessEgressWalk(false);

    final Scenario scenario = ScenarioUtils.loadScenario(config);
    Controler controler = new Controler(scenario);

    EventsManager events = controler.getEvents();

    final List<CongestionEvent> congestionEvents = new ArrayList<CongestionEvent>();
    final List<PersonMoneyEvent> moneyEvents = new ArrayList<PersonMoneyEvent>();

    events.addHandler(
        new CongestionEventHandler() {

          @Override
          public void reset(int iteration) {}

          @Override
          public void handleEvent(CongestionEvent event) {
            congestionEvents.add(event);
          }
        });

    events.addHandler(
        new PersonMoneyEventHandler() {

          @Override
          public void reset(int iteration) {}

          @Override
          public void handleEvent(PersonMoneyEvent event) {
            moneyEvents.add(event);
          }
        });

    final TollHandler tollHandler = new TollHandler(controler.getScenario());
    final TollDisutilityCalculatorFactory tollDisutilityCalculatorFactory =
        new TollDisutilityCalculatorFactory(tollHandler, controler.getConfig().planCalcScore());
    controler.addOverridingModule(
        new AbstractModule() {
          @Override
          public void install() {
            addControlerListenerBinding()
                .toProvider(
                    new Provider<ControlerListener>() {
                      @Inject Scenario scenario;
                      @Inject EventsManager eventsManager;

                      @Override
                      public ControlerListener get() {
                        return new AdvancedMarginalCongestionPricingContolerListener(
                            scenario,
                            tollHandler,
                            new CongestionHandlerImplV3(eventsManager, (MutableScenario) scenario));
                      }
                    });
            bindCarTravelDisutilityFactory().toInstance(tollDisutilityCalculatorFactory);
          }
        });
    controler.addOverridingModule(new OTFVisFileWriterModule());
    controler
        .getConfig()
        .controler()
        .setOverwriteFileSetting(
            OutputDirectoryHierarchy.OverwriteFileSetting.overwriteExistingFiles);
    controler.run();

    // test if there is only one congestion event and only one money event
    Assert.assertEquals("Wrong number of congestion events.", 1, congestionEvents.size());
    Assert.assertEquals("Wrong number of money events.", 1, moneyEvents.size());

    // test if the delay is 2 seconds
    double delay = congestionEvents.get(0).getDelay();
    Assert.assertEquals("Wrong delay.", 2.0, delay, MatsimTestUtils.EPSILON);

    double amountFromEvent = moneyEvents.get(0).getAmount();
    double tripDelayDisutility =
        delay
            / 3600.
            * controler
                .getConfig()
                .planCalcScore()
                .getModes()
                .get(TransportMode.car)
                .getMarginalUtilityOfTraveling()
            * (-1);

    // home duration morning: 28800.
    // home duration evening with delay: (24 * 3600.) - 57705.
    // home duration evening without delay: (24 * 3600.) - 57703.

    // with delay --> 80.581739442040600
    // without delay --> 80.584243964094500

    double activityDelayDisutility = 80.584243964094500 - 80.581739442040600;
    double amount =
        (-1)
            * (activityDelayDisutility + tripDelayDisutility)
            / controler.getConfig().planCalcScore().getMarginalUtilityOfMoney();
    Assert.assertEquals("Wrong amount.", amount, amountFromEvent, MatsimTestUtils.EPSILON);
  }