Display Surface and Object2DTorus out of scale??

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Display Surface and Object2DTorus out of scale??

Tivnan, Brian
I might have missed it, but I did not see a response to my post from
last week so I am re-submitting a description of my problem.  Thanks,
Brian  

 

Hello all!

I have been developing a model where my agents are depicted on more
than one torus.  Each torus is used to instantiate its respective
Display Surface.

However, I seem to have created some sort of scaling problem between
the DisplaySurface and the Torus.  

The agents are displayed correctly on the DisplaySurface, but they are
not actually where they appear when I attempt to probe them.  The
confounding thing is that the agents can be probed but only that they
seem to "exist" on a miniaturized torus - essentially the torus seems
to only occupy less than 50% of the display surface.  When discovered
on this "mini-torus" by probing in the top-left region of the
DisplaySurface, the agents report their correct location as depicted on
the DisplaySurface, but cannot be probed at that location on the
DisplaySurface.  

Only one of my three torus / display surface combinations works
correctly, and I can neither detect the difference in the current code
nor previous builds (when I was not having this problem - ahhh).  

Trailing is my buildDisplay etc.

Thanks for any assistance or pointers (even if accompanied with sarcasm
which is justified!)
Brian  

       
        private void buildDisplay() {
                Object2DDisplay agentDisplay = new
Object2DDisplay(agentTorus);
                Object2DDisplay bugDisplay = new
Object2DDisplay(bugTorus);
               
                Object2DDisplay sugarDisplay = new
Object2DDisplay(sugarTorus);
               
                dsurfAgent.addDisplayableProbeable(agentDisplay,
"Agents");
                dsurfBug.addDisplayableProbeable(bugDisplay, "Bugs");
                dsurfAgent.setBackground(Color.GRAY);
                dsurfBug.setBackground(Color.GRAY);

                addSimEventListener(dsurfAgent);
                addSimEventListener(dsurfBug);
               
                dsurfSugar.addDisplayableProbeable(sugarDisplay,
"Sugar");
                dsurfSugar.setBackground(Color.GRAY);
                addSimEventListener(dsurfSugar);
        }

        protected void buildSchedule() {
                super.buildSchedule();
                schedule.scheduleActionBeginning(1, this,
"updateDisplay");
                schedule.scheduleActionAtPause(this, "updateDisplay");
                schedule.scheduleActionAtEnd(this, "updateDisplay");
        }
       
        public void updateDisplay() {
                dsurfAgent.updateDisplay();
                dsurfBug.updateDisplay();
                dsurfSugar.updateDisplay();
        }
       
        public void begin(){
                buildModel();
          buildDisplay();
          buildSchedule();
          dsurfAgent.display();
          dsurfBug.display();
          dsurfSugar.display();
        }

        public void setup() {
                super.setup();
          if (dsurfAgent != null)
                        dsurfAgent.dispose();
                dsurfAgent = null;
         
          if (dsurfBug != null)
                        dsurfBug.dispose();
                dsurfBug = null;
               
          dsurfAgent = new DisplaySurface(this, "Agents");
          dsurfBug = new DisplaySurface(this, "Bugs");
          registerDisplaySurface("Agents", dsurfAgent);
          registerDisplaySurface("Bugs", dsurfBug);
         
          if (this.dsurfSugar != null)
                        this.dsurfSugar.dispose();
                this.dsurfSugar = null;
                this.dsurfSugar = new DisplaySurface(this, "Sugar");
          registerDisplaySurface("Sugar", this.dsurfSugar);
         
        }


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
<a href="http://ads.osdn.com/?ad_idv28&alloc_id845&op=click">http://ads.osdn.com/?ad_idv28&alloc_id845&op=click
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest