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
4746f729
Commit
4746f729
authored
May 14, 2019
by
Vladislav Kiselev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ещё оптимизация.
parent
7765658a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
12 deletions
+28
-12
src/constraints/conversion_2_with_partial_cargo_operations.mzn
...onstraints/conversion_2_with_partial_cargo_operations.mzn
+28
-12
No files found.
src/constraints/conversion_2_with_partial_cargo_operations.mzn
View file @
4746f729
...
...
@@ -429,6 +429,22 @@ array [0..n_operations] of 0..n_locations : operations_destination; % Локац
)
);
array
[
1
..
n_operations
,
1
..
n_intervals
]
of
var
bool
:
is_cargo_op_not_exceeds_storage_limits
;
constraint
forall
(
op
in
1
..
n_operations
,
t
in
1
..
n_intervals
)
(
is_cargo_op_not_exceeds_storage_limits
[
op
,
t
]
=
((
not
is_moving_operation
[
op
])
->
(
let
{
1
..
n_obj_with_storage
:
m_stor
=
operations_main_stor
[
op
];
1
..
n_obj_with_storage
:
s_stor
=
operations_secondary_stor
[
op
];
1
..
n_cargo_types
:
cargo
=
operations_cargo_t
[
op
];
int
:
delta
=
loading_op_direction
[
op
];
}
in
(
storage_used_volume
[
m_stor
,
t
,
cargo
]
+
delta
>=
0
)
/\
((
sum
(
c
in
1
..
n_cargo_types
)
(
storage_used_volume
[
m_stor
,
t
,
c
]))
+
delta
<=
max_storage_vol
[
m_stor
])
/\
(
storage_used_volume
[
s_stor
,
t
,
cargo
]
-
delta
>=
0
)
/\
((
sum
(
c
in
1
..
n_cargo_types
)
(
storage_used_volume
[
s_stor
,
t
,
c
]))
-
delta
<=
max_storage_vol
[
s_stor
])
))
);
% Определение is_op_possible.
constraint
forall
(
op
in
1
..
n_operations
,
t
in
1
..
n_intervals
)
(
is_op_possible
[
op
,
t
]
=
(
...
...
@@ -447,18 +463,8 @@ array [0..n_operations] of 0..n_locations : operations_destination; % Локац
current_moored_obj
[
operations_destination
[
op
],
t
]
=
0
)
)
/\
% Если это операция пришвартовки, то в этот интервал
% причал должен быть свободным.
((
not
is_moving_operation
[
op
])
->
(
let
{
1
..
n_obj_with_storage
:
m_stor
=
operations_main_stor
[
op
];
1
..
n_obj_with_storage
:
s_stor
=
operations_secondary_stor
[
op
];
1
..
n_cargo_types
:
cargo
=
operations_cargo_t
[
op
];
int
:
delta
=
loading_op_direction
[
op
];
}
in
(
storage_used_volume
[
m_stor
,
t
,
cargo
]
+
delta
>=
0
)
/\
((
sum
(
c
in
1
..
n_cargo_types
)
(
storage_used_volume
[
m_stor
,
t
,
c
]))
+
delta
<=
max_storage_vol
[
m_stor
])
/\
(
storage_used_volume
[
s_stor
,
t
,
cargo
]
-
delta
>=
0
)
/\
((
sum
(
c
in
1
..
n_cargo_types
)
(
storage_used_volume
[
s_stor
,
t
,
c
]))
-
delta
<=
max_storage_vol
[
s_stor
])
))
/\
% Если это операция грузообработки, то она не выведет
% объём берегового хранилища и хранилища судна за
(
is_cargo_op_not_exceeds_storage_limits
[
op
,
t
])
% Если это операция грузообработки, то она не выведет
/\
% объём берегового хранилища и хранилища судна за
% границы дозволенного (если исполнится при минимальной
% интенсивности 1).
(((
not
is_moving_operation
[
op
])
/\
(
main_obj_start_loc
[
op
]
mod
2
=
1
))
->
...
...
@@ -480,6 +486,16 @@ array [0..n_operations] of 0..n_locations : operations_destination; % Локац
(
op_start
[
op
,
t
]
/\
(
not
is_fixed
[
op
,
t
]))
->
not
is_op_possible
[
op
,
t
-
1
]
);
% Оптимизация - есть две соседние операции погрузки - первая операция должна быть максимально загруженной.
constraint
forall
(
op
in
1
..
n_operations
,
t
in
2
..
n_intervals
)
(
((
cargo_op_intensity
[
op
,
t
-
1
]
!=
0
)
/\
(
cargo_op_intensity
[
op
,
t
]
!=
0
))
->
(
(
cargo_op_intensity
[
op
,
t
-
1
]
=
loading_op_abs_delta
[
op
])
\/
% Операция достигла предела интенсивности.
(
not
is_cargo_op_not_exceeds_storage_limits
[
op
,
t
-
1
])
% Или операция нарушит границы хранилищ
\/
% при увеличении интенсивности.
(
is_fixed
[
op
,
t
])
% Или операция фиксирована.
)
);
% Критерий оптимизации
array
[
1
..
(
n_intervals
+
1
)]
of
var
bool
:
is_not_terminated
;
% В конце всё остановится.
...
...
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