Hi,

  I'm describing the movements of a car with Jess rules.  I'm using Java to 
define the main structures of the program and Jess to write rules that must 
change the position, orientation, ... of the car.

  My problem is that the car makes too many movements where it shouldn't.  I 
had this problem before, and I could make it work, but now it seems to be 
imposible.

  I've got this rule:

  (defrule car-turns
    (car (position ?pos)
         (orientation ?o)
         (OBJECT ?c))
    (position (OBJECT ?old-pos&:(and (eq ?o (call ?c computeOrientation ?pos 
?old-pos))
                                     (not (call ?c isAllowed ?old-pos))
                                )
              )
    )
    (position (OBJECT ?new-pos&: ...))
  =>
    (set ?c orientation (call ?c computeOrientation ?old-pos ?new-pos))
    ...
  )

  Ok, that was the code.  The problem is that when there are different 
posibilities (the car can turn right or left) all of them are activated 
(that's ok) but then all of them are executed.  And I think they shouldn't 
be executed because the car's orientation has been changed, and ?o should 
change and after executing the first activated rule, the rest of activations 
should be deactivated!

  I think there's something I'm doing wrong or that I don't understand using 
Java objects from Jess.

  Any help will be wellcome.  Thanks,

    Cherman.

_________________________________________________________________
Hable con sus amigos en l�nea, pruebe MSN Messenger: http://messenger.msn.es


--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to