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
ecec6470
Commit
ecec6470
authored
May 14, 2019
by
Vladislav Kiselev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Испралено is_op_possible, в часчичных операциях пеперь работает оптимизация.
parent
11f822b9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
14 deletions
+15
-14
src/constraints/conversion_2.mzn
src/constraints/conversion_2.mzn
+4
-4
src/constraints/conversion_2_with_partial_cargo_operations.mzn
...onstraints/conversion_2_with_partial_cargo_operations.mzn
+11
-10
No files found.
src/constraints/conversion_2.mzn
View file @
ecec6470
...
...
@@ -417,7 +417,7 @@ array [0..n_operations] of 0..n_locations : operations_destination; % Локац
(
current_moving_operation
[
main_obj_of_operation
[
op
],
t
]
=
0
)
/\
% Главный объект не участвует в операции перемещеня.
(
is_enough_free_resources
[
op
,
t
]
=
true
)
/\
% Достаточно свободных ресурсов на нужном месте.
(
forall
(
conf_op
in
conflicting_operations
[
op
])
(
op_status
[
op
,
t
]
=
false
))
(
forall
(
conf_op
in
conflicting_operations
[
op
])
(
op_status
[
conf_
op
,
t
]
=
false
))
/\
% Не выполняется ни одной конфликтующей операции.
(
is_moving_operation
[
op
]
->
not
is_involved_in_cargo_op
[
main_obj_of_operation
[
op
],
t
])
/\
% Если это операция перемещения, то главный объект
...
...
@@ -433,14 +433,14 @@ array [0..n_operations] of 0..n_locations : operations_destination; % Локац
int
:
delta
=
loading_op_delta_of_main_obj
[
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
argo
]))
+
delta
<=
max_storage_vol
[
m_stor
])
/\
((
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
argo
]))
-
delta
<=
max_storage_vol
[
s_stor
])
((
sum
(
c
in
1
..
n_cargo_types
)
(
storage_used_volume
[
s_stor
,
t
,
c
]))
-
delta
<=
max_storage_vol
[
s_stor
])
))
/\
% Если это операция грузообработки, то она не выведет
% объём берегового хранилища и хранилища судна за
% границы дозволенного.
(((
not
is_moving_operation
[
op
])
/\
(
main_obj_start_loc
[
op
]
mod
2
=
1
))
->
((
current_moored_obj
[
twin_location
[
main_obj_start_loc
[
op
]],
t
]
=
0
)
/\
((
current_moored_obj
[
twin_location
[
main_obj_start_loc
[
op
]],
t
]
=
0
)
\/
(
current_moored_obj
[
twin_location
[
main_obj_start_loc
[
op
]],
t
]
=
main_obj_of_operation
[
op
]))
)
/\
% Если это операция грузообработки без пришвартовки,
% то причал должен быть свободен в этот интервал, либо
...
...
src/constraints/conversion_2_with_partial_cargo_operations.mzn
View file @
ecec6470
...
...
@@ -438,7 +438,7 @@ array [0..n_operations] of 0..n_locations : operations_destination; % Локац
(
current_moving_operation
[
main_obj_of_operation
[
op
],
t
]
=
0
)
/\
% Главный объект не участвует в операции перемещеня.
(
is_enough_free_resources
[
op
,
t
]
=
true
)
/\
% Достаточно свободных ресурсов на нужном месте.
(
forall
(
conf_op
in
conflicting_operations
[
op
])
(
op_status
[
op
,
t
]
=
false
))
(
forall
(
conf_op
in
conflicting_operations
[
op
])
(
op_status
[
conf_
op
,
t
]
=
false
))
/\
% Не выполняется ни одной конфликтующей операции.
(
is_moving_operation
[
op
]
->
not
is_involved_in_cargo_op
[
main_obj_of_operation
[
op
],
t
])
/\
% Если это операция перемещения, то главный объект
...
...
@@ -451,17 +451,18 @@ array [0..n_operations] of 0..n_locations : operations_destination; % Локац
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_d
elta_of_main_obj
[
op
];
int
:
delta
=
loading_op_d
irection
[
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
argo
]))
+
delta
<=
max_storage_vol
[
m_stor
])
/\
((
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
argo
]))
-
delta
<=
max_storage_vol
[
s_stor
])
((
sum
(
c
in
1
..
n_cargo_types
)
(
storage_used_volume
[
s_stor
,
t
,
c
]))
-
delta
<=
max_storage_vol
[
s_stor
])
))
/\
% Если это операция грузообработки, то она не выведет
% объём берегового хранилища и хранилища судна за
% границы дозволенного.
% границы дозволенного (если исполнится при минимальной
% интенсивности 1).
(((
not
is_moving_operation
[
op
])
/\
(
main_obj_start_loc
[
op
]
mod
2
=
1
))
->
((
current_moored_obj
[
twin_location
[
main_obj_start_loc
[
op
]],
t
]
=
0
)
/\
((
current_moored_obj
[
twin_location
[
main_obj_start_loc
[
op
]],
t
]
=
0
)
\/
(
current_moored_obj
[
twin_location
[
main_obj_start_loc
[
op
]],
t
]
=
main_obj_of_operation
[
op
]))
)
/\
% Если это операция грузообработки без пришвартовки,
% то причал должен быть свободен в этот интервал, либо
...
...
@@ -473,12 +474,12 @@ array [0..n_operations] of 0..n_locations : operations_destination; % Локац
% и не участвует в операциях перемещения.
)
);
/*
% Сам критерий оптимизации - если если операцию можно было начать на 1 интервал раньше, то её нужно начать раньше.
constraint
forall
(
op
in
1
..
n_operations
,
t
in
2
..
n_intervals
)
(
(
op_start
[
op
,
t
]
/\
(
not
is_fixed
[
op
,
t
]))
->
not
is_op_possible
[
op
,
t
-
1
]
);
*/
% Критерий оптимизации
array
[
1
..
(
n_intervals
+
1
)]
of
var
bool
:
is_not_terminated
;
% В конце всё остановится.
...
...
@@ -512,9 +513,9 @@ output [show(sum(is_not_terminated)), "\n",
"current_moored_obj = "
,
show
(
current_moored_obj
),
"\n\n"
,
"cargo_op_intensity = "
,
show
(
cargo_op_intensity
),
"\n\n"
,
/*
"is_op_possible {"
,
show
(
n_intervals
),
"} = "
,
show
(
is_op_possible
),
"\n\n"
,
"debug_1 {", show(n_intervals), "} = ", show(debug_1), "\n\n",
/*
"is_enough_free_resources {", show(n_intervals), "} = ", show(is_enough_free_resources), "\n\n",
"operation_of_counter {", show(n_resources_counters), "} = ", show(operation_of_counter), "\n\n",
"possible_resources_counter {", show(n_intervals), "} = ", show(possible_resources_counter), "\n\n",
...
...
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