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
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
"exist" on a miniaturized torus - essentially the torus seems to only
occupy less than 50% of the display surface.  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);
         
        }


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest