swarm-hackers
[Top][All Lists]
Advanced

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

[swarm-hackers] Re: A new (non-framework-related) problem...


From: Nima Talebi
Subject: [swarm-hackers] Re: A new (non-framework-related) problem...
Date: Fri, 13 Nov 2009 13:06:37 +1100

Oh, and in case anyone is bored....

git clone address@hidden:heatbugs.git          

The branch is called "behaviors" (Heatbugs no longer have -step, rather a behavior category adds the -step method to the heatbug, and the particular behavior that makes the heatbugs act as they do in the original version of heatbugs (the original -step) is not implemented as the GetComfortable <AgentActions> class.

This way, many different behaviors/actions can decide the fate of the agent, agents may or may not be compliant for any particular behavior, and once completing a defined number of iterations on any action/behavior, they can move onto another, for example GetComfortable, Mate, Talk, Hide, Fight, etc.

The categories add methods to the now-simpler heatbug swarm agents, while the AgentActions class allows for an equivalent of additional "data members" which store states specific to each type of behavior.

The swarm agents do not need to know about the behaviors at all, the category will wrap around the agent, and dynamically bind methods and psuedo-data-members as previously described.

...that's the plan/work-in-progress anyway :)

Nima


On Fri, Nov 13, 2009 at 12:58 PM, Nima Talebi <address@hidden> wrote:
I'm getting a continuous stream of warnings like this in my vastly modified version of heatbugs (as part of a learning process for myself, and working towards deciding what to do for my thesis next semester)...

...
Grid2d: you're overwriting object 26c128 at (82,45) with object 0x26ebc8 (Heatbug).
Grid2d does not support two objects in one place.
*** execution continuing...
*** event raised for warning: WarningMessage
Grid2d: you're overwriting object 26e4d8 at (62,78) with object 0x270208 (Heatbug).
Grid2d does not support two objects in one place.
*** execution continuing...
*** event raised for warning: WarningMessage
Grid2d: you're overwriting object 274b48 at (112,2) with object 0x273a68 (Heatbug).
Grid2d does not support two objects in one place.
*** execution continuing...
*** event raised for warning: WarningMessage
Grid2d: you're overwriting object 2375f8 at (57,14) with object 0x26e668 (Heatbug).
....


I have assert statements prior to every single move that a heatbug makes...

- (void)setX:(int)inX andY:(int)inY {
    static BOOL firstTime = TRUE;
    if((inX != [self x]) && (inY != [self y])) {
        // Update heat where we were sitting.
        [heatSpace addHeat:[self outputHeat] X:[self x] Y:[self y]];
       
        NSString *s = [NSString stringWithFormat:@"Found agent %@ here, expected %@ (self)",
                       [world getObjectAtX:[self x] Y:[self y]], self];

        if(!firstTime) {
            NSAssert([world getObjectAtX:[self x] Y:[self y]] == self, s);
        }   
        [world putObject:nil atX:[self x] Y:[self y]];
       
        // And where we're going...
        x = inX;
        y = inY;
        if(!firstTime) {
            NSAssert([world getObjectAtX:[self x] Y:[self y]] == nil, @"shit 2");
            firstTime = FALSE;
        }   
        [world putObject:self atX:[self x] Y:[self y]];
    }   
}



...These never get triggered, so as far as I can tell, the -setX:andY: will only ever work, iff the new position is vacant.  If that is the case however, why am I getting these warnings?

Note: the reason for firstTime is because the initial positioning of the heatbugs from [HeatbugsModel -buildObjects] does no checking for double occupancy.


--
Nima Talebi
web: http://ai.autonomy.net.au/People/Nima
gpg: B51D 1F18 D8E2 B702 B027 23A4 E06B DAC1 BE70 ADC0



--
Nima Talebi
web: http://ai.autonomy.net.au/People/Nima
gpg: B51D 1F18 D8E2 B702 B027 23A4 E06B DAC1 BE70 ADC0

reply via email to

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