Subject: | |
From: | |
Reply To: | |
Date: | Wed, 16 Jan 2019 16:27:29 -0500 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
I checked and confirmed that my agents are not getting replaced by different agents on each timestep.
I don’t think my geomPortrayal is causing this, but I’m including the code here:
public class agentGeomPortrayal extends GeomPortrayal {
public Paint determineColor(Object object) {
// determines color by healthstatus of the agent
int hColor = (int) (((MasonGeometry)object).getUserData());
// System.out.println("determineColor>healthstatus: " + hColor);
if (hColor < 2) { return healthy; } // assume healthy first...to reduce computation
else if (hColor >= 10) {return dead; }
else if (hColor >= 8) { return lethal; }
else if (hColor >= 6) { return sickHigh; }
else if (hColor >= 4) { return sickMed; }
else if (hColor >= 2) { return sickLow; }
else return healthy; // default to healthy
}
public void draw (Object object, Graphics2D graphics, DrawInfo2D info) {
scale = 0.0003; // set scale of the portrayal
paint = determineColor(object);
super.draw(object, graphics, info);
}
}
I've also now tested different versions of the getSimulationInspectedObject() method, and it doesn't appear to be called when I doubleclick on an agent object in the GUI window. The Inspectors window remains blank.
Any suggestions for why the method may be failing?
Thanks,
Annetta
|
|
|