Skip to content

Commit

Permalink
added the run.java script to transform a matsim run into a solver input
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonSering committed Jun 2, 2024
1 parent e378c10 commit 7e8bdfa
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions run.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import ch.sbb.rssched.client.RsschedMatsimClient;
import ch.sbb.rssched.client.config.RsschedRequestConfig;
import ch.sbb.rssched.client.dto.response.Response;

public class Example {

private static final String SCHEDULER_BASE_URL = "http://localhost";
private static final int SCHEDULER_PORT = 3000;

public static void main(String[] args) {
RsschedRequestConfig config = RsschedRequestConfig.builder()
.setInputDirectory("../matsim_run")
.setOutputDirectory("..")
.setRunId("runId")
// optionally set transit line filter, default is no filtering
.setFilterStrategy(scenario -> {
// implementation...
return null;
}).buildWithDefaults();

// optionally set sample size factor, default is 1.0
config.getGlobal().setSampleSize(0.25);

RsschedMatsimClient client = new RsschedMatsimClient(SCHEDULER_BASE_URL, SCHEDULER_PORT);
Response response = client.process(config);
}

}

0 comments on commit 7e8bdfa

Please sign in to comment.