Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
Conversion
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Vladislav Kiselev
Conversion
Commits
5520bb48
Commit
5520bb48
authored
Nov 27, 2018
by
Vladislav Kiselev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Упрощение. Теперь все bool значения сравниваются только с соответствующими константами.
parent
49424e24
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
18 deletions
+13
-18
constraints/conversion_0.mzn
constraints/conversion_0.mzn
+13
-18
No files found.
constraints/conversion_0.mzn
View file @
5520bb48
...
...
@@ -18,9 +18,9 @@ array [1..n_moving_obj, 1..n_locations] of set of 1..n_operations : departure_op
% Определение m_obj_loc.
constraint
forall
(
obj
in
1
..
n_moving_obj
,
j
in
1
..
(
n_intervals
+
1
))
((
m_obj_loc
[
obj
,
j
]
!=
0
)
->
(
(
m_obj_loc
[
obj
,
j
]
==
m_obj_loc
[
obj
,
j
-
1
]
/\
(
forall
(
k
in
departure_op
[
obj
,
m_obj_loc
[
obj
,
j
]])
(
op_status
[
k
,
j
-
1
]
==
0
)))
(
m_obj_loc
[
obj
,
j
]
==
m_obj_loc
[
obj
,
j
-
1
]
/\
(
forall
(
k
in
departure_op
[
obj
,
m_obj_loc
[
obj
,
j
]])
(
not
op_status
[
k
,
j
-
1
]
)))
\/
(
exists
(
k
in
arrival_op
[
obj
,
m_obj_loc
[
obj
,
j
]])
(
op_fin
[
k
,
j
-
1
]
!=
0
))
(
exists
(
k
in
arrival_op
[
obj
,
m_obj_loc
[
obj
,
j
]])
(
op_fin
[
k
,
j
-
1
]))
));
% Начальное состояние.
...
...
@@ -38,7 +38,7 @@ constraint forall (i in 1..n_operations, j in {0, n_intervals + 1}) (op_status[i
% Определение op_start и op_fin.
constraint
forall
(
op
in
1
..
n_operations
,
j
in
{
0
,
n_intervals
+
1
})
(
op_start
[
op
,
j
]
=
=
0
/\
op_fin
[
op
,
j
]
==
0
);
(
op_start
[
op
,
j
]
=
false
/\
op_fin
[
op
,
j
]
=
false
);
constraint
forall
(
i
in
1
..
n_operations
,
j
in
1
..
(
n_intervals
+
1
))
(
op_start
[
i
,
j
]
=
(
op_status
[
i
,
j
]
/\
not
op_status
[
i
,
j
-
1
]));
constraint
forall
(
i
in
1
..
n_operations
,
j
in
1
..
n_intervals
)
(
op_fin
[
i
,
j
]
=
(
op_status
[
i
,
j
]
/\
not
op_status
[
i
,
j
+
1
]));
...
...
@@ -50,15 +50,12 @@ constraint forall (i in 1..n_operations where is_continuous_operation[i]) (
let
{
var
int
:
len
=
operations_duration
[
i
]}
in
(
forall
(
j
in
1
..
(
n_intervals
-
len
+
1
))
(
(
op_start
[
i
,
j
]
==
1
)
->
(
(
forall
(
k
in
1
..
(
len
-
1
))
(
op_status
[
i
,
j
+
k
]
==
1
)
)
/\
(
op_status
[
i
,
j
+
len
]
==
0
)
(
forall
(
k
in
1
..
(
len
-
1
))
(
op_status
[
i
,
j
+
k
]))
/\
(
not
op_status
[
i
,
j
+
len
])
)
))
/\
(
forall
(
j
in
(
n_intervals
-
len
+
2
)
..
(
n_intervals
+
1
))
(
op_start
[
i
,
j
]
==
0
)
)
(
forall
(
j
in
(
n_intervals
-
len
+
2
)
..
(
n_intervals
+
1
))
(
op_start
[
i
,
j
]
==
false
))
);
% Наличие всех ресурсов на месте во время начала операции перемещения.
...
...
@@ -78,7 +75,7 @@ array [1..n_conflicting_op] of 1..n_operations : confl_op_1;
array
[
1
..
n_conflicting_op
]
of
1
..
n_operations
:
confl_op_2
;
constraint
forall
(
t
in
0
..
(
n_intervals
+
1
),
i
in
1
..
n_conflicting_op
)
(
(
op_status
[
confl_op_1
[
i
],
t
]
->
not
op_status
[
confl_op_2
[
i
],
t
])
op_status
[
confl_op_1
[
i
],
t
]
->
not
op_status
[
confl_op_2
[
i
],
t
]
);
% Окна непогоды.
...
...
@@ -88,7 +85,7 @@ array [1..n_bad_weather_windows] of 0..(n_intervals + 1) : bw_start;
array
[
1
..
n_bad_weather_windows
]
of
0
..
(
n_intervals
+
1
)
:
bw_fin
;
% Включительно.
constraint
forall
(
i
in
1
..
n_bad_weather_windows
,
t
in
bw_start
[
i
]
..
bw_fin
[
i
])
(
op_status
[
bw_op
[
i
],
t
]
==
0
op_status
[
bw_op
[
i
],
t
]
==
false
);
% Грузообработка.
...
...
@@ -140,11 +137,11 @@ constraint forall (storage in 1..n_obj_with_storage, cargo in 1..n_cargo_types,
% Критерий оптимизации
array
[
0
..
(
n_intervals
+
1
)]
of
var
bool
:
is_not_terminated
;
constraint
(
is_not_terminated
[
0
]
==
0
/\
is_not_terminated
[
n_intervals
+
1
]
==
0
);
constraint
(
is_not_terminated
[
0
]
==
false
/\
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
]
==
1
))
(
exists
(
op
in
1
..
n_operations
)
(
op_status
[
op
,
t
]))
\/
is_not_terminated
[
t
+
1
]
)
...
...
@@ -187,15 +184,13 @@ array [1..n_moving_obj, 0..(n_intervals + 1)] of var bool : is_m_obj_useful; %
op_status
[
useful_op_id
[
i
],
t
]
->
is_m_obj_useful
[
useful_op_obj
[
i
],
t
]
);
constraint
forall
(
obj
in
1
..
n_moving_obj
,
t
in
0
..
(
n_intervals
+
1
))
(
% Недопущение "ложного срабатывания" is_m_obj_useful.
is_m_obj_useful
[
obj
,
t
]
->
exists
(
useful_op
in
obj_useful_operations
[
obj
])
(
op_status
[
useful_op
,
t
]
==
true
)
is_m_obj_useful
[
obj
,
t
]
->
exists
(
useful_op
in
obj_useful_operations
[
obj
])
(
op_status
[
useful_op
,
t
])
);
array
[
1
..
n_moving_obj
,
0
..
(
n_intervals
+
1
)]
of
var
bool
:
is_obj_in_moving
;
array
[
1
..
n_moving_obj
]
of
set
of
1
..
n_operations
:
moving_op_of_obj
;
% Операции перемещения затрагивающие данный объект.
constraint
forall
(
obj
in
1
..
n_moving_obj
,
t
in
0
..
(
n_intervals
+
1
))
(
is_obj_in_moving
[
obj
,
t
]
=
exists
(
moving_op
in
moving_op_of_obj
[
obj
])
(
op_status
[
moving_op
,
t
]
=
true
)
is_obj_in_moving
[
obj
,
t
]
=
exists
(
moving_op
in
moving_op_of_obj
[
obj
])
(
op_status
[
moving_op
,
t
])
);
array
[
1
..
n_moving_obj
,
0
..
(
n_intervals
+
1
)]
of
var
bool
:
is_interval_useful
;
% Была ли на текущем интервале полезная операция.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment