Exact solver
Solver
This Solver solves certain scheduling problems optimally
It can handle:
Classic JSSP
Classic FJSSP
both of the above with and without tool constraints
optimization criteria tardiness and makespan
- class agents.solver.solver.OrToolSolver
Bases:
object
This class can be used to solve JSSP problems. It can handle:
Classic JSSP
Classic FJSSP
both of the above with and without tool constraints
optimization criteria tardiness and makespan
Data needs to be passed in ‘instance format’ and is returned in this format, too.
- classmethod optimize(instance: List[Task], objective: str = 'makespan')
Optimizes the passed instance according to the passed objective.
- Parameters
instance (List[Task]) – The instance as a list of Tasks
objective (str) – Bbjective to be minimized. May be ‘makespan’ or ‘tardiness’.
- Returns
tuple(list[Task], float) Solved instance and objective value
- static parse_instance_to_solver_format(instance: List[Task])
Parses the instance to a processable format.
- Parameters
instance (list[Task]) – The instance as a list of Tasks
- Returns
jobs lists with Tuples for every task, including all necessary information for the solver function machine_id(s), processing_time, due_date(set to 0 for all but last task in job), tool
- Example
Job2 = [([0, 2, 3], 8, 0, 4), ([0, 2, 3], 6, 0, 2), …]
- static parse_to_plottable_format(original_instance: List[Task], assigned_jobs_by_solver)
Reformats the solution into the original instance format to be passed to the gantt chart generator.
- Parameters
original_instance (list[Tasks]) – Original instance in original format
assigned_jobs_by_solver – solution passed by the optimize() function
- Returns
list[Tasks] plottable solved instance
- agents.solver.solver.get_perser_args()
parse arguments from command line
- agents.solver.solver.main(instances_data_file_path, solver_objective, write_to_file=False, plot_gantt_chart=False)