I have been building an agent based model in parallel directly from Jess (in Eclipse) and from Java. The method that causes the jess (but not Java) error is inherited from the MarketAgent superclass. Code that works in Java but not Jess is this:

public class User extends MarketAgent {
   ValueVector attributedemands;
   Rete engine = new Rete();
   private PropertyChangeSupport pcs = new PropertyChangeSupport(this);

   public User(String name) {
       super(name);
       super.setEngine(engine);
       setAttributedemands(generateAttributesList(25, 5, 0.8));
// alternatively with same problem: attributedemands = generateAttributesList(25, 5, 0.8);
   }

The setter and getter are:

   public void setAttributedemands(ValueVector attributes) {
       attributedemands = attributes;
   }

   public ValueVector getAttributedemands() {
       return attributedemands;
   }

If the attributedemands line is omitted, there is no problem. If the getAttributedemands method is omitted, there is also no problem. With any of these omissions, attributedemands is null in Java, nil in Jess. With the omissions, the attributedemands ValueVector has an appropriate value in Java but I get the following error message in jess:

(deftemplate MAIN::agent
  "$JAVA-OBJECT$ org.cfpm.markets.User"
  (declare (from-class org.cfpm.markets.User))
  (slot attributedemands)
  (slot class)
  (multislot location)
  (slot name)
  (slot OBJECT))
Jess reported an error in routine new
   while executing (new User "harvey")
   while executing (bind ?user-agent (new User "harvey")).
 Message: Constructor threw an exception.
 Program text: ( bind ?user-agent ( new User "harvey" ) )  at line 16.

Nested exception is:
null


The Jess code is:

(defclass agent User)
(printout t (ppdeftemplate agent) crlf)

(bind ?user-agent (new User "harvey"))

(definstance agent ?user-agent)


Finally, the problem is the same using either beta 2 or beta 3.

Thanks in advance for any help on this.

Scott

--------------------------------------------------------------------
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