swarm-hackers
[Top][All Lists]
Advanced

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

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


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

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

reply via email to

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