main app now accepting argument: --start-trains

This commit is contained in:
Stephan Richter
2020-11-14 17:07:51 +01:00
parent 9be9d922f2
commit 9233240d25
3 changed files with 13 additions and 1 deletions

View File

@@ -642,6 +642,10 @@ public class Train extends BaseClass implements Comparable<Train> {
return t("Started {}",this);
}
public static void startAll() {
for (Train train : list()) train.automatic();
}
private void startSimulation() {
for (Contact contact : route.contacts()) {
if (contact.addr() != 0) return; // simulate train only when all contacts are non-physical