[eclipse-clp-users] Hybrid modeling of VRP and Eclipse coding doubt

From: nishant raj <nishantraj5132_at_...6...>
Date: Mon, 27 Jun 2011 18:08:38 +0530
Dear sir,
I am working on Hybrid modeling as my summer project.
I am presently stuck in the coding part...
my modeling is done...i Have some doubts regarding coding

1 .I have got the codes for nosubtour from a prof Gilles Pesant.But i am not
able to understand it clearly.

2.  in the modeling part i have written nosubtour(S) where Si € N    " i € N
    (Si is the Direct Successor of node i.) and N is the number of nodes. so
how is this code helpful for me in fulfilling the place of nosubtour.

3. could you please give some insight about the parameters used here,because
i am not getting it completly. The code was in french, i translated it into
english and made some useful changes so that it can compile in Eclipse 6.0
and above versions.
But, how should i replace "nosubtour(S)" with these line of code.
Please, reply as soon as possible.
here are the codes :



--------------------------------------------------------------------------------------
% The list does not describe a sub-cycle.
pas_de_sous_cycle(L, N, Paths):-
Arrival is N + 1,
pas_de_sous_cycle(1, L, Arrival, Paths),
pas_de_sous_cycle(_, [ ], _, _),
pas_de_sous_cycle(I, [Si|Rest], Arrival, Paths): -
Si #\= I,% defend the trivial loop
% Fall asleep a goal that will represent a path from eventual
% A If i can form a sub-cycle.
make_suspension(pas_de_sous_cycle_par_Si(I, Si, Arrival, paths), 3, Susp),
insert_suspension([Si], Susp, inst of suspend, suspend),
J is I + 1,
pas_de_sous_cycle(J, Rest, Arrival, Paths).

%%%%%%%%
%Pas_de_sous_cycle_par_Si(+I,+Si,+ Arrival,?Paths)
%
% Predicate-constraint that is awakening when Si is instantiated.
% It prevents the new partial path and a loop on itself
% And it updates the data structure to reflect this new path.
% NOTE: This release is an update to more advanced (but
% Always in constant time) in order to find the beginning and end of
% Partial path for a chemin_ _interieurs sites, not just
% For the control point. Just follow the pointers until a
% Self-reference.
%%%%%%%%
pas_de_sous_cycle_par_Si(I, Si, Arrival, Paths):-
(Si >= Arrival->
% The new path leading to the site of arrival:
% No loop to defend.
% Update the field "last" of I_premier and I
arg(I, Paths, TermI),
setarg(2, TermI, Si),
TermI = i(I_premier ,_,_),
arg(I_premier, Paths, TermI_p),
setarg(2, TermI_p, Si)
;
arg(Si, Paths, TermSi),
TermSi = i(_,J_dernier,_),
(J_dernier < Arrival ->
arg(I, Paths, TermI),TermI = i(I_premier ,_,_),
arg(J_dernier, Paths, TermJ),
arg(I_premier, Paths, TermI_p),
arg(3, TermJ, SJ_dernier),
SJ_dernier #\= I_premier,
% should not wrap
% Update the fields "first" and "last"
setarg(1, TermSi, I_premier),
setarg(1, TermJ, I_premier),
setarg(2, TermI, J_dernier),
setarg(2, TermI_p, J_dernier)
;
% This new path leading to the site of arrival
% No loop to defend.
% Update the field "last" of I_premier and I
arg(I, Paths, TermI),
setarg(2, TermI, J_dernier),
TermI = i(I_premier ,_,_),
arg(I_premier, Paths, TermI_p),
setarg(2, TermI_p, J_dernier),
% Update the field "first" Si
setarg(1, TermSi, I_premier)
)).


----------------------------------------------------
-- 
NISHANT RAJ
FINAL YEAR UNDERGRADUATE STUDENT
DEPARTMENT OF INDUSTRIAL ENGG.& MANAGEMENT
IIT KHARAGPUR
Phone (+91)-7501320429,9735565064
Received on Mon Jun 27 2011 - 12:38:44 CEST

This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:20 CEST