FoPra Beluga Challenge - Reinforcement Learning v1.0
Deep Reinforcement Learning solution for the Beluga Challenge shipping container optimization problem using PPO and MCTS
|
Complete state representation for the Beluga Challenge. More...
Public Member Functions | |
__init__ (self, list[Jig] jigs, list[Beluga] belugas, list[int|None] trailers_beluga, list[int|None] trailers_factory, list[Rack] racks, list[ProductionLine] production_lines, list[int|None] hangars) | |
Initialize the complete problem state. | |
copy (self) | |
Create a deep copy of the entire problem state. | |
clone (self) | |
Create a clone of the current state (alias for copy) | |
is_terminal (self) | |
Check if this state represents a terminal (goal) state. | |
float | evaluate (self, int depth, mu=0.05) |
Evaluate the current state for MCTS scoring. | |
dict[str, float] | get_subgoals (self) |
Calculate subgoal achievements for evaluation. | |
apply_action (self, action_name, params) | |
Apply an action to this state. | |
bool | check_action_valid (self, str action_name, params=None) |
Check if an action with given parameters is valid. | |
enumerate_valid_params (self, action) | |
Enumerate all valid parameter combinations for a given action. | |
get_possible_actions (self) | |
Get list of all possible actions in the current state. | |
bool | beluga_complete (self) |
Mark current beluga as complete and remove it. | |
get_observation_high_level (self) | |
Get high-level observation array for RL agents. | |
__str__ (self) | |
__repr__ (self) | |
__hash__ (self) | |
__eq__ (self, other) | |
Public Attributes | |
jigs = jigs | |
belugas = belugas | |
trailers_beluga = trailers_beluga | |
trailers_factory = trailers_factory | |
racks = racks | |
production_lines = production_lines | |
hangars = hangars | |
int | belugas_unloaded = 0 |
int | belugas_finished = 0 |
int | production_lines_finished = 0 |
total_lines = len(self.production_lines) | |
total_belugas = len(self.belugas) | |
bool | problem_solved = False |
str | jigs = "\t" + str(count) + ": " + str(jig) + "\n" |
str | belugas = "\t" + str(count) + ": " + str(beluga) + "\n" |
str | racks = "\t" + str(count) + ": " + str(rack) + "\n" |
str | production_lines = "\t" + str(count) + ": " + str(production_line) + "\n" |
Complete state representation for the Beluga Challenge.
Contains all components of the problem: jigs, ships, storage, and facilities. Provides the main API for MCTS and RL algorithms including state transitions, validation, and evaluation functions.
rl.env.state.ProblemState.__init__ | ( | self, | |
list[Jig] | jigs, | ||
list[Beluga] | belugas, | ||
list[int | None] | trailers_beluga, | ||
list[int | None] | trailers_factory, | ||
list[Rack] | racks, | ||
list[ProductionLine] | production_lines, | ||
list[int | None] | hangars ) |
Initialize the complete problem state.
jigs | List of all jigs in the problem |
belugas | List of Beluga ships |
trailers_beluga | List of Beluga trailer slots (jig IDs or None) |
trailers_factory | List of factory trailer slots (jig IDs or None) |
racks | List of storage racks |
production_lines | List of production lines |
hangars | List of hangar slots (jig IDs or None) |
rl.env.state.ProblemState.__eq__ | ( | self, | |
other ) |
rl.env.state.ProblemState.__hash__ | ( | self | ) |
rl.env.state.ProblemState.__repr__ | ( | self | ) |
rl.env.state.ProblemState.__str__ | ( | self | ) |
rl.env.state.ProblemState.apply_action | ( | self, | |
action_name, | |||
params ) |
Apply an action to this state.
action_name | Name of the action to execute |
params | Parameters for the action (dict or list) |
bool rl.env.state.ProblemState.beluga_complete | ( | self | ) |
Mark current beluga as complete and remove it.
bool rl.env.state.ProblemState.check_action_valid | ( | self, | |
str | action_name, | ||
params = None ) |
Check if an action with given parameters is valid.
action_name | Name of the action to validate |
params | Parameters for the action (optional) |
This function validates an action without modifying the current state.
rl.env.state.ProblemState.clone | ( | self | ) |
Create a clone of the current state (alias for copy)
rl.env.state.ProblemState.copy | ( | self | ) |
Create a deep copy of the entire problem state.
rl.env.state.ProblemState.enumerate_valid_params | ( | self, | |
action ) |
Enumerate all valid parameter combinations for a given action.
action | Name of the action to enumerate parameters for |
float rl.env.state.ProblemState.evaluate | ( | self, | |
int | depth, | ||
mu = 0.05 ) |
Evaluate the current state for MCTS scoring.
depth | Current depth in the search tree |
mu | Penalty factor for depth (default 0.05) |
rl.env.state.ProblemState.get_observation_high_level | ( | self | ) |
Get high-level observation array for RL agents.
The observation includes information about belugas, trailers, hangars, and racks. High-level agents convert this array into tensors for neural network processing.
rl.env.state.ProblemState.get_possible_actions | ( | self | ) |
Get list of all possible actions in the current state.
An action is considered possible if at least one valid parameter combination exists.
dict[str, float] rl.env.state.ProblemState.get_subgoals | ( | self | ) |
Calculate subgoal achievements for evaluation.
rl.env.state.ProblemState.is_terminal | ( | self | ) |
Check if this state represents a terminal (goal) state.
rl.env.state.ProblemState.belugas = belugas |
str rl.env.state.ProblemState.belugas = "\t" + str(count) + ": " + str(beluga) + "\n" |
int rl.env.state.ProblemState.belugas_finished = 0 |
int rl.env.state.ProblemState.belugas_unloaded = 0 |
rl.env.state.ProblemState.hangars = hangars |
rl.env.state.ProblemState.jigs = jigs |
str rl.env.state.ProblemState.jigs = "\t" + str(count) + ": " + str(jig) + "\n" |
bool rl.env.state.ProblemState.problem_solved = False |
rl.env.state.ProblemState.production_lines = production_lines |
str rl.env.state.ProblemState.production_lines = "\t" + str(count) + ": " + str(production_line) + "\n" |
int rl.env.state.ProblemState.production_lines_finished = 0 |
rl.env.state.ProblemState.racks = racks |
str rl.env.state.ProblemState.racks = "\t" + str(count) + ": " + str(rack) + "\n" |
rl.env.state.ProblemState.total_belugas = len(self.belugas) |
rl.env.state.ProblemState.total_lines = len(self.production_lines) |
rl.env.state.ProblemState.trailers_beluga = trailers_beluga |
rl.env.state.ProblemState.trailers_factory = trailers_factory |