Re: [eclipse-clp-users] help

From: Kish Shen <kish.shen_at_...6...>
Date: Fri, 23 Oct 2015 18:47:45 +0100
Hi Rana,

I cannot really spend the time to look at your whole program in detail. I
can only provide help for specific points like why your program might be

For this, I asked you to show your code for the check predicate (I did not
expect you to send your whole program), and also to say what you meant
exactly by your program aborting -- which you didn't answer.

I took a quick look at your check/4 predicate, and it is not clear how it
will lead to sharing. It is also unclear to me how it will lead to ECLiPSe
aborting, although it might lead to your program failing, is this what
happened -- failing is not the same as aborting.

I cannot really figure out what the intended meaning of your check/4 is --
it is called with a new variable Event in all the 4 arguments. Event is a
free variable at this point, and I suspect this is not what you intended.
If you are unfamiliar with Prolog, I strongly suggest that you learn Prolog
before attempting to write your application program.

Also, you can try to debug your own program using ECLiPSe's debugger/tracer
-- did you try this?



On Thu, Oct 22, 2015 at 10:00 PM, Rana Mohamed <eng.ranamoh_at_...6...>

> Thanks for your concern, the whole program is in the attachment it
> contains the definition of each agent, where the definitions consist of the
> location of the agent, the  variable and time at the start and the end of
> the location and the knowledge which remains the same at the each location.
> also contains how agent evolve, where it evolve continuously at the same
> location and discretely when an event fired which make the agent moves from
> location to another and also if we have more than one agent has a
> synchronized event it makes the knowledge of each agent shared to the other
> agents.
> the systems works using the *drive* clause which starts with the start
> state of each agent, then each agent evolves continuously until an event
> fire to cause the discrete step, the system allows only one event  at a
> time, i've solve the abort problem now the problem  is at the process of
> knowledge sharing  which is done using the *check* clause, using *check*
> at *drive* is not done correctly especially with the constraints of one
> event at a time and i don't know how to solve it.
> On Wed, Oct 21, 2015 at 1:01 PM, Kish Shen <kisshen_at_...5...> wrote:
>> Hi,
>> It is difficult to provide any speicifc help to you, as you have not
>> really given enough of your program. Most importantly, you have not given
>> your code for check/4, the goal that you say is causing ECLiPSe to abort.
>> Also, what precisely do you mean by ECLiPSe "always gave me abort" -- do
>> you mean ECLiPSe raise an error? If so, there should have been an error
>> message printed, which will give you some idea of what went wrong, and you
>> should include this in your report.
>> If on the other hand, the ECLiPSe process aborted (i.e. crashed), then
>> you should state this clearly, and give any messages that you got when this
>> happened.
>> Cheers,
>> Kish
>> On 13/10/2015 09:20, Rana Mohamed wrote:
>>> I'm working on a constraint logic program, which represents the
>>> interaction
>>> of 4 agents (hybrid automata) (disturbance, decay, cargo, truck), they
>>> interacts in terms of events (synchronized or interleaved) the purpose of
>>> interaction is to share their knowledge when there is a synchronized
>>> event,
>>> each agents has a continuous and discrete behavior during the continuous
>>> behavior (at the same state) the knowledge remains the same, during the
>>> discrete steps (agent moves from state to another when an event is
>>> fired).
>>> they update knowledge by adding the shared knowledge (because of the
>>> synchronized event) to the previous knowledge of the agent.
>>> the implementation is:
>>> drive((S1,Y0,Know),(S2,D0,Know1),(S3,X0,Know2),(S4,Z0,Know3),
>>> Starttime,Steps,[(S1,S2,S3,S4,Time,Event,D)|R]):-
>>>      disturbance(S1,[Y0],[Y],Starttime,Ty,Know),
>>>      decay(S2,[D0],[D],Starttime,Td,Know1),
>>>      cargo(S3,[X0],[X],Starttime,Tx,Know2),
>>>      truck(S4, [Z0],[Z],Starttime,Tz,Know3),
>>>      Ty $=Td, Ty $=Tx, Ty $=Tz,Time $=Ty,
>>>   % %  S1,2,3,4 represents the state of each agent
>>> %% D,Y,X,Z is the values at the end and start of state
>>> %% starttime is the start time at state, Td,Tx,Tz the end time at each
>>> %state
>>> % Know is the knowledge at each state.
>>> *
>>> check((Event,Shared1,Know),(Event,Shared2,Know1),(Event,Shared3,Know2),(Event,Shared4,Know3)),
>>>    *
>>> evolve(disturbance,(S1,Y0,Know),(NextS1,YY0,Knowa),Shared1,Starttime,Ty,Event),
>>> evolve(decay,(S2,D0,Know1),(NextS2,DD0,Knowb),Shared2,Starttime,Td,Event),
>>> evolve(cargo,(S3,X0,Know2),(NextS3,XX0,Knowc),Shared3,Starttime,TX,Event),
>>> evolve(truck,(S4,Z0,Know3),(Next
> ------------------------------------------------------------------------------
> _______________________________________________
> ECLiPSe-CLP-Users mailing list
Received on Fri Oct 23 2015 - 17:47:52 CEST

This archive was generated by hypermail 2.3.0 : Fri Aug 16 2019 - 15:13:40 CEST