Skip to content

Commit

Permalink
Limit runs to 1000 agents
Browse files Browse the repository at this point in the history
  • Loading branch information
OmriKaduri committed Aug 5, 2020
1 parent 4053ff6 commit d1a5f66
Show file tree
Hide file tree
Showing 1,410 changed files with 27 additions and 1,215,537 deletions.
Binary file modified .vs/mapf/v15/.suo
Binary file not shown.
Binary file modified .vs/mapf/v15/Server/sqlite3/storage.ide-shm
Binary file not shown.
Binary file modified .vs/mapf/v15/Server/sqlite3/storage.ide-wal
Binary file not shown.
18 changes: 13 additions & 5 deletions IndependenceDetection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public IndependenceDetection(ISolver singleAgentSolver, ISolver groupSolver, Boo
this.singleAgentSolver = singleAgentSolver;
this.groupSolver = groupSolver;
this.withSelection = withSelection;

}

public void Clear()
Expand All @@ -78,15 +77,15 @@ public void Setup(ProblemInstance instance, Run runner)
new IndependenceDetectionAgentsGroup(
this.instance, new AgentState[1] { agentStartState },
this.singleAgentSolver, this.groupSolver, runner, 0));

this.subproblem_id = 0;

}

public virtual String GetName() {
if (this.withSelection)
{
return groupSolver.GetName() + "+ID+AS";
return "ID+AS"; //Group solver has no meaning when it is choosed by AS
}
else
{
Expand Down Expand Up @@ -388,7 +387,7 @@ public bool ImprovedID(Run runner)
}
}

// Groups are conflicting - need to join them to a single group
// Groups are conflicting - need to join them to a single group (If code is here, coulnd't resolve by either conflicts)
allGroups.Remove(conflict.group1);
allGroups.Remove(conflict.group2);
// Remove both groups from avoidance table
Expand Down Expand Up @@ -587,7 +586,7 @@ public IndependenceDetectionAgentsGroup(ProblemInstance instance, AgentState[] a
useOldCost: false,
useCAT: true);

this.runner = runner;
//this.runner = runner;
this.subproblem_id = subproblem_id;
this.timeToSolver = 0;
}
Expand Down Expand Up @@ -696,11 +695,20 @@ public bool SolveWithSelection(Run runner)
}
else
{
Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();

var pred = this.selectionModel.Predict(instance.ml_features.ToArray());
stopwatch.Stop();
Console.WriteLine("Time to predict which solver to use: {0} ms", stopwatch.ElapsedMilliseconds);
stopwatch.Start();

Console.WriteLine($"-----------------AS in ID-{solverNameByIndex(pred)}-----------------");
relevantSolver = solverByIndex(pred, this.instance);

relevantSolver.Setup(this.instance, runner); //TODO: Move setup to ctor
stopwatch.Stop();
Console.WriteLine("Time to setup solver: {0} ms", stopwatch.ElapsedMilliseconds);
}
bool solved = relevantSolver.Solve();
this.solutionCost = relevantSolver.GetSolutionCost();
Expand Down
4 changes: 4 additions & 0 deletions ProblemInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,10 @@ public static ProblemInstance ImportFromScenFile(string fileName)
for (int i = 2; i < lines.Count+1; i++)
{
agentNum = 0;
if (i > 1000)
{
break;
}
stateList = new List<AgentState>();
//var rand_lines = lines.AsEnumerable().OrderBy(n => Guid.NewGuid()).Take(i).Cast<String>().ToList();
var rand_lines = lines.Take(i);
Expand Down
10 changes: 4 additions & 6 deletions Run.cs
Original file line number Diff line number Diff line change
Expand Up @@ -621,18 +621,16 @@ public Run()
// MA - CBS - Global - 10 / (EPEA */ SIC) choosing the first conflict in CBS nodes
//solvers.Add(new CBS(astar, epea, 10));

// ICTS + ID+AS
//solvers.Add(new IndependenceDetection(astar, new CostTreeSearchSolverOldMatching(3),true));
SATSolver satSolver = new SATSolver();
//// EPEA* + ID+AS
solvers.Add(satSolver);
//solvers.Add(new IndependenceDetection(astar, epea,true));
//solvers.Add(satSolver);
// ID+AS (EPEA is just a placeholder, should be removed)
//solvers.Add(new IndependenceDetection(astar, epea, true));

//// ICTS + ID
//solvers.Add(new IndependenceDetection(astar, new CostTreeSearchSolverOldMatching(3)));

//// EPEA* + ID
//solvers.Add(new IndependenceDetection(astar, epea));
solvers.Add(new IndependenceDetection(astar, epea));
//solvers.Add(epea);

//Adding CBS-H + ID:
Expand Down
1 change: 0 additions & 1 deletion bin/Debug/042193d5-180b-4f4e-8beb-2b2ffe4902c6.csv

This file was deleted.

1 change: 0 additions & 1 deletion bin/Debug/06bfc0d0-9669-4dae-b42a-439d73fbb86c.csv

This file was deleted.

7 changes: 0 additions & 7 deletions bin/Debug/12b803dc-ef9b-408e-a8a4-99606b1e7c52.csv

This file was deleted.

Loading

0 comments on commit d1a5f66

Please sign in to comment.