ScapeVector voters; // the agents Overhead2DView overheadView; public (Http web server)

ScapeVector voters; // the agents Overhead2DView overheadView; public void createScape() { super.createScape(); // needed for basic setup lattice = new ScapeArray2DMoore(); lattice.setPrototypeAgent(new HostCell()); lattice.setExtent(new Coordinate2DDiscrete(latticeWidth, latticeHeight)); Voter voter = new Voter(); // see Voter.java voter.setHostScape(lattice); // where agents live voters = new ScapeVector(); voters.setPrototypeAgent(voter); voters.setExecutionOrder(Scape.RULE_ORDER); addAgent(lattice); // add the lattice to the root scape addAgent(voters); // add the voters list to the root scape } public void onSetup() { ((ScapeVector) voters).setExtent(new Coordinate1DDiscrete(latticeWidth*latticeHeight)); } /* * Putting Ascape into pause right away allows the user to see the * initial situation. The alternative is to cale setStartOnOpen(false) , for example in onSetup(). */ public void onStart() { pause(); } public void createViews() { super.createViews(); //Now, add a simple overhead view so that we can view the lattice: overheadView = new Overhead2DView(); //Set its cell size to 12 overheadView.setCellSize(12); //add it to the lattice so that it can view and be controlled by it lattice.addView(overheadView); /* The following code shows how to add some statistic collection to the Voter Agent and have Ascape display it for your. The stats are collected using inner classes. Serveral ways of doing this are shown. The code is straightforward except for one trick which was ot obvious to me. The trick. */ final StatCollector [] stats = {
If you are in need for cheap and reliable webhost to host your website, we recommend http web server services.

Leave a Reply