Information Technology Reference
In-Depth Information
:- module(funkcje_l_p).
:- use_module(dane_l_p).
:- lib(fd).
:- lib(fd_global).
:- lib(fd_search).
:- lib(edge_finder3).
:- lib(branch_and_bound).
:- lib(probing_for_scheduling).
:- local struct(zadanie(start,czas,wymaga,ludzie)).
:- local struct(nazwa(napis)).
:- export
opc/0
.
og_1(X,W):-
(foreach(X1,X),
foreach(W1,W) do
sumlist(X1,X_sum), X_sum #<= W1 ).
og_2(Yt,Z):-
(foreach(Y1,Yt),
foreach(Z1,Z) do
sumlist(Y1,Z1) ).
og_3(Y,Xt):-
(foreach(Y1,Y),
foreach(X1,Xt) do
sumlist(Y1,Y_sum),
sumlist(X1,X_sum), Y_sum #= X_sum ).
s1(L_L1,L_L2):-
flatten(L_L1,L1),
flatten(L_L2,L2),
append(L2,L1,L3),
search(L3,0, most_constrained,indomain_min,complete,[]).
zapis(X,Y):-
open("w_1.txt",write,Sp_1),
flatten(X,X1),
(foreach(X2,X1), param(Sp_1) do
write(Sp_1,X2),
writeln(Sp_1,' ') ),
writeln(Sp_1,' '),
close(Sp_1),
open("w_2.txt",write,Sp_2),
flatten(Y,Y1),
(foreach(Y2,Y1), param(Sp_2) do
write(Sp_2,Y2),
writeln(Sp_2,' ') ),
writeln(Sp_2,' '),
close(Sp_2).
opc:-
dane(Z,C,W,X,Xt,Yt,Y,Razem),
og_1(X,W),
og_2(Yt,Z),
og_3(Y,Xt),
bb_min(s1(X,Yt),Razem, bb_options with [strategy: step]),
zapis(X,Yt).
Fig. 8.b. The MIP model (constraints) for the multi-stage transportation problem-
automatically generated (Eclipse-CLP)
Search WWH ::




Custom Search