Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hermes in combination with MultiModal - silently reverts to qsim #1642

Open
gac55 opened this issue Aug 25, 2021 · 1 comment
Open

Hermes in combination with MultiModal - silently reverts to qsim #1642

gac55 opened this issue Aug 25, 2021 · 1 comment

Comments

@gac55
Copy link
Contributor

gac55 commented Aug 25, 2021

We have been testing Hermes and discovered a silent incompatibility with using the Multi Modal contrib.

Controller:

public class RunMultimodalMatsim {
    public static void main(String[] args) {

        Config config = ConfigUtils.loadConfig(args[0], new MultiModalConfigGroup());
		
	final Scenario scenario = ScenarioUtils.loadScenario(config);		
        PrepareMultiModalScenario.run(scenario);
        Controler controler = new Controler(scenario);
	controler.addOverridingModule(new MultiModalModule());

        controler.run();
    }
}

I attach the full logs which feature a copy of the input configuration. As you can see hermes is clearly specified as the mobsim to be used.

		<param name="mobsim" value="hermes" />

and is also configured specifically.

.... but during the simulation we see:

2021-08-25T15:40:59,880  INFO Injector:85 org.matsim.core.mobsim.qsim.components.QSimComponentsConfig 

For some reason MATSim then silently reverts to qsim for an unknown reason. If there is some incompatibility, perhaps there should be a warning.

logs.txt

@KasiaKoz
Copy link
Contributor

Adding an override at the end of your controller:

controler.addOverridingModule(new ForceHermesModule());

where

package ...;

import org.matsim.core.mobsim.hermes.HermesProvider;
import org.matsim.core.controler.AbstractModule;

public class ForceHermesModule extends AbstractModule {

    public void install() {
        this.bindMobsim().toProvider(HermesProvider.class);
    }
}

will force the use of hermes with multimodal. I stepped through it in debug and it does use multimodal's scoring and travel time computations, and the mobsim used is indeed hermes. But you will loose some functionality provided in qsim that (i dont think) exists in hermes, like cars passing bikes on shared links. I'm trying to get to the bottom of these things here: #2181.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants