MASON-INTEREST-L Archives

January 2019

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Annetta Burger <[log in to unmask]>
Reply To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Date:
Wed, 16 Jan 2019 16:27:29 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (33 lines)
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

ATOM RSS1 RSS2