Skip to content

Commit

Permalink
Optional check for blocking.
Browse files Browse the repository at this point in the history
  • Loading branch information
PaoloForte95 committed Sep 27, 2023
1 parent 25d8cc1 commit f91fd9f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ public class ConstraintOptimizationProblem extends ConstraintOptimization{

protected int numAllocation;

protected boolean checkBlocking;

//Paths
protected HashMap<Integer, PoseSteering[]> pathsToTargetGoal = new HashMap<Integer, PoseSteering[]>();
protected ArrayList <SpatialEnvelope> pathsDrivingRobots = new ArrayList <SpatialEnvelope>();
Expand Down Expand Up @@ -198,6 +200,7 @@ public ConstraintOptimizationProblem(boolean instanceFleetMaster){
}
metaCSPLogger = MetaCSPLogging.getLogger(this.getClass());
numAllocation = 1;
checkBlocking = false;

}

Expand Down Expand Up @@ -1098,11 +1101,17 @@ protected double[][][] computeTardiness(double [][][]PAll) {

return BFunction;
}

public void checkforBlocking(){
this.checkBlocking = true;
}


public int [][][] findOptimalAssignment(AbstractOptimizationAlgorithm optimizationSolver){
realRobotsIDs = coordinator.getIdleRobots();
checkOnBlocking();
if(checkBlocking){
checkOnBlocking();
}
return super.findOptimalAssignment(optimizationSolver);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ public class LinearOptimizationProblem extends LinearOptimization{

protected int numAllocation;

protected boolean checkBlocking;

//Paths
protected HashMap<Integer, PoseSteering[]> pathsToTargetGoal = new HashMap<Integer, PoseSteering[]>();
protected ArrayList <SpatialEnvelope> pathsDrivingRobots = new ArrayList <SpatialEnvelope>();
Expand All @@ -91,6 +93,8 @@ public class LinearOptimizationProblem extends LinearOptimization{
protected String scenario;
protected boolean saveFutureAllocations = false;



/**
* The default footprint used for robots if none is specified.
* NOTE: coordinates in footprints must be given in in CCW or CW order.
Expand Down Expand Up @@ -197,6 +201,7 @@ public LinearOptimizationProblem(boolean instanceFleetMaster){
}
metaCSPLogger = MetaCSPLogging.getLogger(this.getClass());
numAllocation = 1;
checkBlocking = false;

}

Expand Down Expand Up @@ -1100,11 +1105,17 @@ protected double[][][] computeTardiness(double [][][]PAll) {

return BFunction;
}

public void checkforBlocking(){
this.checkBlocking = true;
}


public int [][][] findOptimalAssignment(AbstractOptimizationAlgorithm optimizationSolver){
realRobotsIDs = coordinator.getIdleRobots();
checkOnBlocking();
if(checkBlocking){
checkOnBlocking();
}
return super.findOptimalAssignment(optimizationSolver);
}

Expand Down

0 comments on commit f91fd9f

Please sign in to comment.