diff --git a/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceLCCM.scala b/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceLCCM.scala index 1c2547c4dbf..7f699aef2b5 100755 --- a/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceLCCM.scala +++ b/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceLCCM.scala @@ -108,10 +108,7 @@ class ModeChoiceLCCM( /* * Evaluate and sample from classmembership, then sample from corresponding mode choice model */ - val random = { - val seed = beamServices.beamConfig.matsim.modules.global.randomSeed - new Random(seed) - } + val chosenClassOpt = lccm .classMembershipModels(tourType) .sampleAlternative(classMembershipInputData, random) diff --git a/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceMultinomialLogit.scala b/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceMultinomialLogit.scala index 9384bc1777c..3642c8a9023 100755 --- a/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceMultinomialLogit.scala +++ b/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceMultinomialLogit.scala @@ -63,8 +63,7 @@ class ModeChoiceMultinomialLogit(val beamServices: BeamServices, val model: Mult }.toMap val chosenModeOpt = { - val seed = beamServices.beamConfig.matsim.modules.global.randomSeed - model.sampleAlternative(inputData, new Random(seed)) + model.sampleAlternative(inputData, random) } expectedMaximumUtility = model.getExpectedMaximumUtility(inputData).getOrElse(0) diff --git a/src/main/scala/beam/agentsim/agents/modalbehaviors/ModeChoiceCalculator.scala b/src/main/scala/beam/agentsim/agents/modalbehaviors/ModeChoiceCalculator.scala index 29862676731..88ea34bf784 100755 --- a/src/main/scala/beam/agentsim/agents/modalbehaviors/ModeChoiceCalculator.scala +++ b/src/main/scala/beam/agentsim/agents/modalbehaviors/ModeChoiceCalculator.scala @@ -20,7 +20,7 @@ import scala.util.Random trait ModeChoiceCalculator { val beamConfig: BeamConfig - implicit lazy val random: Random = new Random( + lazy val random: Random = new Random( beamConfig.matsim.modules.global.randomSeed )