Skip to content

Commit

Permalink
fix dependency graph for command execution
Browse files Browse the repository at this point in the history
  • Loading branch information
rakow committed Dec 18, 2024
1 parent 3e6cfc7 commit ca02b61
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,17 @@ public void run(Path input) {
Class<? extends MATSimAppCommand> clazz = e.getKey();
graph.addVertex(clazz);
Dependency[] depends = ApplicationUtils.getSpec(clazz).dependsOn();

boolean hasDependencies = false;
for (Dependency d : depends) {
if (d.required()) {
// Add dependency graph if the dependency is executed as well
if (args.containsKey(d.value())) {
graph.addVertex(d.value());
graph.addEdge(d.value(), clazz);
hasDependencies = true;
}
}
if (depends.length == 0)
if (!hasDependencies)
start.add(clazz);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public Integer call() throws Exception {
}


String tripStatsPath = input.getPath("trip_stats.csv");
String tripStatsPath = input.getPath(TripAnalysis.class,"trip_stats.csv");
System.out.println("Path: " + tripStatsPath);


Expand Down

0 comments on commit ca02b61

Please sign in to comment.