|
From: | Paul Johnson |
Subject: | Re: [Swarm-Support] creating an object from a Class other than ModelSwarm. |
Date: | Wed, 09 Mar 2005 22:05:40 -0600 |
User-agent: | Mozilla Thunderbird 0.9 (X11/20041127) |
"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 ina 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: 825Agent 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
[Prev in Thread] | Current Thread | [Next in Thread] |