swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swarm-Support] creating an object from a Class other thanModelSwarm


From: Derek Farren
Subject: Re: [Swarm-Support] creating an object from a Class other thanModelSwarm.
Date: Thu, 10 Mar 2005 11:23:31 -0300

Paul, I hope I could ever meet you in order to thank you all the help you have gave me in person.

Thanks again...

Derek Farren
----- Original Message ----- From: "Paul Johnson" <address@hidden>
To: "Swarm Support" <address@hidden>
Sent: Thursday, March 10, 2005 1:05 AM
Subject: Re: [Swarm-Support] creating an object from a Class other thanModelSwarm.


"self" can't be a Zone unless you are in a Swarm.

Replace self in creaeBegin with [self getZone] and the problem will go away.

I assure you that it is technically possible to create objects in any kind of class.

IT used to be in the old days that we always used [self getZone], but when Swarm and GUISwarm became Zones, there was no need to get the zone anymore. SO self works well enough. It is one of the "streamlining" efforts that occurred right before the first Swarmfest I ever went to, which I think was in 1998.

For questions like this, I bet that tutorial I've been encouraging people to test out will help you. You find "swarmapps-obj" in here
http://lark.cc.ku.edu/~pauljohn/Swarm.

pj

Derek Farren wrote:
Hello everybody.

From my experienece with swarm, it seems like you can´t create an object in

a class other than ModelSwarm (and ObserverSwarm, of course).

For example, if I have the ClassA.h and ClassB.h (none of them ModelSwarm.h) and I have in one of ClassA´s method aClassB = [ClassB createBegin: self]; sentence, the bash window gives me the following error:

*** event raised for error: InvalidArgument
*** function: _i_Object_s__doesNotRecognize_(), file: /src/Swarm/swarm/src/defobj/DefObject.m, line: 825
Agent does not recognize allocIVars:
*** execution terminating due to error
/src/Swarm/swarm/src/defobj/Symbol.m:187 -[Error(c) _raiseEvent:]

This doesn´t happen if I create objects in the ModelSwarm class.

Am I right?

If so, how can I create objects in classes other than ModelSwarm?

Thanks

Derek Farren
_______________________________________________
Support mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/support


--
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ku.edu/~pauljohn
1541 Lilac Lane, Rm 504
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66044-3177           FAX: (785) 864-5700
_______________________________________________
Support mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/support




reply via email to

[Prev in Thread] Current Thread [Next in Thread]