Class AgentsTasksTimes
java.lang.Object
topics.backtracking.times.AgentsTasksTimes
BACKTRACKING PROBLEM: THE PROBLEM OF ASSIGNING N TASK TO AGENTS
This program can solve the problem using a backtracking algorithm
- Author:
- vicegd
-
Constructor Summary
ConstructorsConstructorDescriptionAgentsTasksTimes(int n) Constructor, sets the size of the problem and makes the array to store the state of the problem -
Method Summary
Modifier and TypeMethodDescriptionvoidbacktracking(int agent) Backtracking that solves the stated problemvoidexecute()Measures execution times for the backtracking assignment problem.voidRandom generation of the cost matrixstatic voidvoidPrints the best solution foundvoidPrints cost matrix
-
Constructor Details
-
AgentsTasksTimes
public AgentsTasksTimes(int n) Constructor, sets the size of the problem and makes the array to store the state of the problem- Parameters:
n- Number of agents and tasks
-
-
Method Details
-
main
-
execute
public void execute()Measures execution times for the backtracking assignment problem. -
generateCostMatrix
public void generateCostMatrix()Random generation of the cost matrix -
printCosts
public void printCosts()Prints cost matrix -
backtracking
public void backtracking(int agent) Backtracking that solves the stated problem- Parameters:
agent- , number of the agent we are going to work with
-
printBestSol
public void printBestSol()Prints the best solution found
-