From a3e421a5b9dd0388caae4c7eb126059eef41606e Mon Sep 17 00:00:00 2001 From: Vlad_kv Date: Tue, 4 Dec 2018 12:56:13 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=BD=D1=91=D1=81=20?= =?UTF-8?q?=D0=B2=20=D0=B4=D1=80=D1=83=D0=B3=D0=BE=D0=B5=20=D0=BC=D0=B5?= =?UTF-8?q?=D1=81=D1=82=D0=BE.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {constraints => src/constraints}/conversion_0.mzn | 7 +++---- {constraints => src/constraints}/conversion_1.mzn | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) rename {constraints => src/constraints}/conversion_0.mzn (97%) rename {constraints => src/constraints}/conversion_1.mzn (98%) 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 89a9058..6fbc039 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 1ef946a..6fb0e7b 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", -- GitLab