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
0ea72898
Commit
0ea72898
authored
Aug 05, 2019
by
Vladislav Kiselev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conversion_2.mzn исправлен для корректного сведения к flatzinc
parent
370260e9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
src/constraints/conversion_2.mzn
src/constraints/conversion_2.mzn
+14
-12
No files found.
src/constraints/conversion_2.mzn
View file @
0ea72898
...
...
@@ -59,8 +59,8 @@ array [0..n_moving_obj, 0..n_operations] of bool : moving_op_of_obj;
array
[
0
..
n_locations
,
0
..
n_moving_obj
,
1
..
op_with_nominally_mooring_max_size
]
of
1
..
n_operations
:
op_with_nominally_mooring
;
% current_moored_obj соответствуе какому-либо реально пришвартованному объекту.
constraint
forall
(
loc
in
1
..
n_locations
,
t
in
1
..
n_intervals
,
obj
=
current_moored_obj
[
loc
,
t
]
where
loc
mod
2
=
0
)
(
constraint
forall
(
loc
in
1
..
n_locations
,
t
in
1
..
n_intervals
where
loc
mod
2
=
0
)
(
let
{
var
0
..
n_moving_obj
:
obj
=
current_moored_obj
[
loc
,
t
]}
in
(
obj
!=
0
)
->
((
m_obj_loc
[
obj
,
t
]
=
loc
)
\/
(
exists
(
op
in
[
op_with_nominally_mooring
[
loc
,
obj
,
id
]
|
id
in
1
..
op_with_nominally_mooring_sizes
[
loc
,
obj
]])
(
op_status
[
op
,
t
]))
...
...
@@ -68,7 +68,8 @@ array [0..n_moving_obj, 0..n_operations] of bool : moving_op_of_obj;
);
% Если объект пришвартован или швартуется, то current_moored_obj об это знает.
constraint
forall
(
obj
in
1
..
n_moving_obj
,
t
in
1
..
n_intervals
,
loc
=
m_obj_loc
[
obj
,
t
])
(
constraint
forall
(
obj
in
1
..
n_moving_obj
,
t
in
1
..
n_intervals
)
(
let
{
var
0
..
n_locations
:
loc
=
m_obj_loc
[
obj
,
t
]}
in
(
loc
mod
2
=
0
)
->
(
current_moored_obj
[
loc
,
t
]
=
obj
)
);
...
...
@@ -260,23 +261,24 @@ array [0..n_operations] of 0..n_locations : operations_destination; % Локац
% Наличие главных объектов на месте.
constraint
forall
(
op
in
1
..
n_operations
,
t
in
1
..
n_intervals
,
obj
=
main_obj_of_operation
[
op
])
(
t
in
1
..
n_intervals
)
(
let
{
1
..
n_moving_obj
:
obj
=
main_obj_of_operation
[
op
]}
in
op_start
[
op
,
t
]
->
(
m_obj_loc
[
obj
,
t
]
==
main_obj_start_loc
[
op
])
);
% Наличие бункеровщиков на месте.
constraint
forall
(
op
in
1
..
n_operations
,
t
in
1
..
n_intervals
,
obj
=
bunker_of_cargo_op
[
op
]
where
obj
!=
0
)
(
op_start
[
op
,
t
]
->
(
m_obj_loc
[
obj
,
t
]
==
bunker_start_loc
[
op
])
t
in
1
..
n_intervals
where
bunker_of_cargo_op
[
op
]
!=
0
)
(
op_start
[
op
,
t
]
->
(
m_obj_loc
[
bunker_of_cargo_op
[
op
]
,
t
]
==
bunker_start_loc
[
op
])
);
% Непрерывность перемещения и швартовки.
array
[
0
..
n_operations
]
of
int
:
operations_duration
;
array
[
0
..
n_operations
]
of
bool
:
is_continuous_operation
;
constraint
forall
(
i
in
1
..
n_operations
,
len
=
operations_duration
[
i
]
where
is_continuous_operation
[
i
])
(
constraint
forall
(
i
in
1
..
n_operations
where
is_continuous_operation
[
i
])
(
let
{
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
]))
...
...
@@ -375,11 +377,11 @@ array [0..n_operations] of 0..n_locations : operations_destination; % Локац
array
[
0
..
n_operations
,
0
..
n_intervals
]
of
bool
:
is_fixed
;
array
[
0
..
n_moving_obj
,
0
..
(
n_intervals
+
1
)]
of
bool
:
is_obj_involved_in_fixed_op
;
constraint
forall
(
no
in
1
..
n_fixed_op
,
op
=
fixed_op
[
no
]
)
(
constraint
forall
(
no
in
1
..
n_fixed_op
)
(
forall
(
t
in
fixed_op_start
[
no
]
..
fixed_op_end
[
no
])
(
(
op_status
[
op
,
t
])
/\
(
op_status
[
fixed_op
[
no
]
,
t
])
/\
forall
(
obj
in
fixed_op_resources
[
no
])
(
participation_as_resource
[
obj
,
t
]
=
op
participation_as_resource
[
obj
,
t
]
=
fixed_op
[
no
]
)
)
);
...
...
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