diff --git a/constraints/conversion_0.mzn b/src/constraints/conversion_0.mzn similarity index 97% rename from constraints/conversion_0.mzn rename to src/constraints/conversion_0.mzn index 89a90584ef26807e1fc2887332be53a44c312c57..6fbc039741d1d439729d4204b300a3851be7402f 100644 --- a/constraints/conversion_0.mzn +++ b/src/constraints/conversion_0.mzn @@ -72,12 +72,11 @@ constraint forall (i in 1..n_operations where is_continuous_operation[i]) ( int : operations_resources_max_size; array [1..n_operations] of 0..operations_resources_max_size : operations_resources_sizes; array [1..n_operations, 1..operations_resources_max_size] of 1..n_moving_obj : operations_resources; +array [1..n_operations, 1..operations_resources_max_size] of 0..n_locations : operations_resources_start_loc; % Положения ресурсов в момент начала операции. -array [1..n_operations] of 0..n_locations : operations_start_loc; - -constraint forall (op in 1..n_operations, j in 1..n_intervals) ( +constraint forall (op in 1..n_operations, t in 1..n_intervals) ( forall (op_res_id in 1..operations_resources_sizes[op]) ( - (op_start[op, j]) -> (m_obj_loc[operations_resources[op, op_res_id], j] == operations_start_loc[op]) + (op_start[op, t]) -> (m_obj_loc[operations_resources[op, op_res_id], t] == operations_resources_start_loc[op, op_res_id]) ) ); diff --git a/constraints/conversion_1.mzn b/src/constraints/conversion_1.mzn similarity index 98% rename from constraints/conversion_1.mzn rename to src/constraints/conversion_1.mzn index 1ef946a146e776220bf098a63cbc2c61c24468f0..6fb0e7b091d28206cad330d9e6593ab859088d9b 100644 --- a/constraints/conversion_1.mzn +++ b/src/constraints/conversion_1.mzn @@ -104,12 +104,11 @@ constraint forall (i in 1..n_operations where is_continuous_operation[i]) ( int : operations_resources_max_size; array [1..n_operations] of 0..operations_resources_max_size : operations_resources_sizes; array [1..n_operations, 1..operations_resources_max_size] of 1..n_moving_obj : operations_resources; - -array [1..n_operations] of 0..n_locations : operations_start_loc; +array [1..n_operations, 1..operations_resources_max_size] of 0..n_locations : operations_resources_start_loc; % Положения ресурсов в момент начала операции. constraint forall (op in 1..n_operations, t in 1..n_intervals) ( forall (op_res_id in 1..operations_resources_sizes[op]) ( - (op_start[op, t]) -> ((m_obj_loc[operations_resources[op, op_res_id], t] == operations_start_loc[op]) /\ + (op_start[op, t]) -> ((m_obj_loc[operations_resources[op, op_res_id], t] == operations_resources_start_loc[op, op_res_id]) /\ (not is_m_obj_in_movement_before_start[operations_resources[op, op_res_id], t])) ) ); @@ -211,6 +210,7 @@ constraint forall (t in 1..n_intervals) ( ) ); +/* Сломано... % Ограничение на совершение полезной операции при движении назад (окончание отшвартовки - "полезная операция"). array [1..n_moving_obj, 0..(n_intervals + 1)] of var 0..n_locations : next_m_obj_loc; % Позиция движущегося объекта на ближайшей остановке. @@ -275,7 +275,7 @@ constraint forall (obj in 1..n_moving_obj, t in 1..n_intervals) ( % Само о (next_m_obj_loc[obj, t + 1] == prev_m_obj_loc[obj, t]) ) -> is_interval_useful[obj, t - 1] ); - +*/ solve minimize sum(is_not_terminated); output [show(sum(is_not_terminated)), "\n",