Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
FedericoPecora committed Feb 14, 2020
2 parents 89b6c09 + 8b266ac commit 0039cbd
Showing 1 changed file with 10 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ protected void localCheckAndRevise() {

//System.out.println("Caller of updateDependencies(): " + Thread.currentThread().getStackTrace()[2]);
synchronized(solver) {
HashMap<Integer,RobotReport> currentReports = new HashMap<Integer,RobotReport>();
HashMap<Integer,HashSet<Dependency>> currentDeps = new HashMap<Integer,HashSet<Dependency>>();
HashMap<Integer,HashSet<Dependency>> artificialDependencies = new HashMap<Integer,HashSet<Dependency>>();
HashSet<Dependency> currentReversibleDependencies = new HashSet<Dependency>();
Expand All @@ -587,7 +588,9 @@ protected void localCheckAndRevise() {
Set<Integer> robotIDs = trackers.keySet();
for (int robotID : robotIDs) {
AbstractTrajectoryEnvelopeTracker robotTracker = trackers.get(robotID);
//Update the coordinator view
RobotReport robotReport = robotTracker.getRobotReport();
currentReports.put(robotID, robotReport);
synchronized(stoppingPoints) {
if (stoppingPoints.containsKey(robotID)) {
metaCSPLogger.info("Stopping points Robot"+robotID+": "+stoppingPoints.get(robotID).toString());
Expand All @@ -609,18 +612,12 @@ protected void localCheckAndRevise() {
}
}

HashMap<Integer,RobotReport> currentReports = new HashMap<Integer,RobotReport>();


//Make deps from critical sections, and remove obsolete critical sections
synchronized(allCriticalSections) {

depsToCS.clear();

//Update the coordinator view
for (int robotID : robotIDs) {
currentReports.put(robotID,this.getRobotReport(robotID));
}

depsToCS.clear();
this.blocked = false;

HashSet<CriticalSection> toRemove = new HashSet<CriticalSection>();
Expand Down Expand Up @@ -1519,7 +1516,7 @@ protected void updateGraph(HashSet<Pair<Integer,Integer>> edgesToDelete, HashSet
protected void globalCheckAndRevise() {

synchronized(solver) {

HashMap<Integer,RobotReport> currentReports = new HashMap<Integer,RobotReport>();
HashMap<Integer,HashSet<Dependency>> currentDeps = new HashMap<Integer,HashSet<Dependency>>();
HashMap<Integer,HashSet<Dependency>> artificialDependencies = new HashMap<Integer,HashSet<Dependency>>();
DirectedMultigraph<Integer,Dependency> depsGraph = new DirectedMultigraph<Integer, Dependency>(Dependency.class);
Expand All @@ -1533,7 +1530,9 @@ protected void globalCheckAndRevise() {
Set<Integer> robotIDs = trackers.keySet();
for (int robotID : robotIDs) {
AbstractTrajectoryEnvelopeTracker robotTracker = trackers.get(robotID);
//Update the coordinator view
RobotReport robotReport = robotTracker.getRobotReport();
currentReports.put(robotID, robotReport);
synchronized(stoppingPoints) {
if (stoppingPoints.containsKey(robotID)) {
metaCSPLogger.info("Stopping points Robot"+robotID+": "+stoppingPoints.get(robotID).toString());
Expand All @@ -1557,18 +1556,13 @@ protected void globalCheckAndRevise() {
}
}

HashMap<Integer,RobotReport> currentReports = new HashMap<Integer,RobotReport>();


//Make deps from critical sections, and remove obsolete critical sections
synchronized(allCriticalSections) {

depsToCS.clear();

//Update the coordinator view
for (int robotID : robotIDs) {
currentReports.put(robotID,this.getRobotReport(robotID));
}


HashSet<CriticalSection> toRemove = new HashSet<CriticalSection>();

this.blocked = false;
Expand Down

0 comments on commit 0039cbd

Please sign in to comment.