-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
post process option to run commands after sim has finished (#1934)
- Loading branch information
Showing
4 changed files
with
131 additions
and
18 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
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
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
27 changes: 27 additions & 0 deletions
27
contribs/application/src/test/java/org/matsim/application/TestCommand.java
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,27 @@ | ||
package org.matsim.application; | ||
|
||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
|
||
/** | ||
* Test command that writes content to file. | ||
*/ | ||
public class TestCommand implements MATSimAppCommand { | ||
|
||
private final Path out; | ||
private final String content; | ||
|
||
public TestCommand(Path out, String content) { | ||
this.out = out; | ||
this.content = content; | ||
} | ||
|
||
|
||
@Override | ||
public Integer call() throws Exception { | ||
|
||
Files.writeString(out, content); | ||
|
||
return 0; | ||
} | ||
} |