-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added the run.java script to transform a matsim run into a solver input
- Loading branch information
1 parent
e378c10
commit 7e8bdfa
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
|
||
} |