Skip to content

Commit

Permalink
Merge pull request #1084 from matsim-org/simwrapper-guice
Browse files Browse the repository at this point in the history
Use Guice to bind SimWrapper dashboards
  • Loading branch information
rakow committed Feb 27, 2024
2 parents 8b51903 + 7935dbb commit 773c1a2
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.matsim.core.scenario.ScenarioUtils;
import org.matsim.core.utils.io.IOUtils;
import org.matsim.examples.ExamplesUtils;
import org.matsim.simwrapper.Dashboard;
import org.matsim.simwrapper.SimWrapper;
import org.matsim.simwrapper.SimWrapperModule;

import java.net.URL;
Expand Down Expand Up @@ -38,9 +38,10 @@ public static void main( String[] args ){

controler.addOverridingModule( new AbstractModule(){
@Override public void install(){
Multibinder.newSetBinder( binder(), Dashboard.class).addBinding().to( RunSimwrappercontribOfflineExample.MyDashboard.class );
// yyyyyy CR was plugging this together via some java functionality. However, it could also be plugged together using
// guice. The above would be the approximate syntax, but I do not know if this was implemented in the meantime. kai, jan'24

// Bind dashboard via guice
SimWrapper.addDashboardBinding(binder()).to( RunSimwrappercontribOfflineExample.MyDashboard.class );

}
} );

Expand Down

0 comments on commit 773c1a2

Please sign in to comment.