From 0a48f1a343eb2d15543369dd2c389e7ad0d71939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B8=D1=81=D0=B5=D0=BB=D1=91=D0=B2=20=D0=92=D0=BB?= =?UTF-8?q?=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2?= Date: Fri, 3 May 2019 23:08:16 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B5=D0=BD=D1=82=D0=B0?= =?UTF-8?q?=D1=80=D0=B8=D0=B8,=20=D0=BD=D0=B5=D0=B7=D0=BD=D0=B0=D1=87?= =?UTF-8?q?=D0=B8=D1=82=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=B5=20=D0=B8=D0=B7?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B2=20constrain?= =?UTF-8?q?t-=D0=B0=D1=85.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/constraints/conversion_2.mzn | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/constraints/conversion_2.mzn b/src/constraints/conversion_2.mzn index 6c421d4..90bb882 100644 --- a/src/constraints/conversion_2.mzn +++ b/src/constraints/conversion_2.mzn @@ -207,6 +207,7 @@ array [1..n_operations] of 1..n_locations : operations_destination; % Локац array [1..n_moving_obj] of set of 1..n_operations : related_cargo_op_using_obj_as_main; % TODO узнать про where + % Определение is_involved_in_cargo_op. constraint forall (obj in 1..n_moving_obj, t in 1..n_intervals) ( is_involved_in_cargo_op[obj, t] = % (exists (op in 1..n_operations where (not is_moving_operation[op]) /\ (main_obj_of_operation[op] = obj)) ( @@ -244,7 +245,7 @@ array [1..n_operations] of 1..n_locations : operations_destination; % Локац по идее это не нужно, но на v2-60 без неё гораздо лучше чем с ней. */ - % Наличие и готовность главных объектов (субъектов). + % Наличие главных объектов (субъектов) на месте. constraint forall (op in 1..n_operations, t in 1..n_intervals, obj = main_obj_of_operation[op]) ( op_start[op, t] -> ((m_obj_loc[obj, t] == main_obj_start_loc[op]) /\ (not is_m_obj_in_movement_before_start[obj, t]) @@ -287,7 +288,7 @@ array [1..n_operations] of 1..n_locations : operations_destination; % Локац % Ограничения на вместимость. array [1..n_obj_with_storage] of int : max_storage_vol; - % Масимальный объём. + % Максимальный объём. constraint forall (storage in 1..n_obj_with_storage, t in 0..(n_intervals + 1)) ( sum (cargo in 1..n_cargo_types) (storage_used_volume[storage, t, cargo]) <= max_storage_vol[storage] ); @@ -428,9 +429,11 @@ array [1..n_operations] of 1..n_locations : operations_destination; % Локац ); % Критерий оптимизации - array [0..(n_intervals + 1)] of var bool : is_not_terminated; - constraint (is_not_terminated[0] == false /\ is_not_terminated[n_intervals + 1] == false); + array [1..(n_intervals + 1)] of var bool : is_not_terminated; + % В конце всё остановится. + constraint (is_not_terminated[n_intervals + 1] == false); + % Действия ещё не остановились, если в текущий интервал что-нибудь происходит или они не остановятся в следующий интервал. constraint forall (t in 1..n_intervals) ( is_not_terminated[t] == ( (exists (op in 1..n_operations) (op_status[op, t])) -- GitLab