forked from J-morag/MAPF
-
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 a CLI * Fixed OS dependent paths * Better default results output
- Loading branch information
Showing
14 changed files
with
329 additions
and
51 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
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
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
56 changes: 56 additions & 0 deletions
56
src/main/java/Environment/RunManagers/GenericRunManager.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,56 @@ | ||
package Environment.RunManagers; | ||
|
||
import BasicMAPF.Instances.InstanceBuilders.I_InstanceBuilder; | ||
import BasicMAPF.Instances.InstanceManager; | ||
import BasicMAPF.Instances.InstanceProperties; | ||
import BasicMAPF.Solvers.CBS.CBS_Solver; | ||
import BasicMAPF.Solvers.PrioritisedPlanning.PrioritisedPlanning_Solver; | ||
import Environment.Experiment; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class GenericRunManager extends A_RunManager { | ||
|
||
private final String instancesDir; | ||
private final int[] agentNums; | ||
private final I_InstanceBuilder instanceBuilder; | ||
private final String experimentName; | ||
private final boolean skipAfterFail; | ||
private final String instancesRegex; | ||
|
||
public GenericRunManager(@NotNull String instancesDir, int[] agentNums, @NotNull I_InstanceBuilder instanceBuilder, | ||
@NotNull String experimentName, boolean skipAfterFail, String instancesRegex, | ||
String resultsOutputDir, String resultsFilePrefix) { | ||
super(resultsOutputDir); | ||
if (agentNums == null){ | ||
throw new IllegalArgumentException("AgentNums can't be null"); | ||
} | ||
this.instancesDir = instancesDir; | ||
this.agentNums = agentNums; | ||
this.instanceBuilder = instanceBuilder; | ||
this.experimentName = experimentName; | ||
this.skipAfterFail = skipAfterFail; | ||
this.instancesRegex = instancesRegex; | ||
this.resultsFilePrefix = resultsFilePrefix; | ||
} | ||
@Override | ||
void setSolvers() { | ||
// TODO modular solvers? | ||
super.solvers.add(new PrioritisedPlanning_Solver()); | ||
super.solvers.add(new CBS_Solver()); | ||
} | ||
|
||
@Override | ||
void setExperiments() { | ||
/* = Set Properties = */ | ||
InstanceProperties properties = new InstanceProperties(null, -1, agentNums, instancesRegex); | ||
|
||
/* = Set Instance Manager = */ | ||
InstanceManager instanceManager = new InstanceManager(instancesDir, instanceBuilder, properties); | ||
|
||
/* = Add new experiment = */ | ||
Experiment experiment = new Experiment(experimentName, instanceManager); | ||
experiment.skipAfterFail = this.skipAfterFail; | ||
this.experiments.add(experiment); | ||
} | ||
|
||
} |
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
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
Oops, something went wrong.