This class models the voter experiment. Each member of a rectangular lattice of voters can, at any time, be in one of a finite number of states, represented by colors. At each time, a voter is chosen at random and then a neighbor of the voter is chosen with various probabilities. The state of the chosen voter is then changed to the state of the chosen neighbor. A screen shot is shown below; click on the graphic to view the live applet and for a more detailed mathematical description.
To add the applet to your web page, first download objects.jar. Next, insert the following in your HTML file, at the point where you want the applet to appear:
<applet code="edu.uah.math.experiments.VoterExperiment.class" archive="address/objects.jar" width="500" height="450"></applet>
where address is the URL address of the JAR file. For example, if the JAR file and the HTML file are in the same folder, the archive property is simply archive="objects.jar". The width and height dimensions are simply suggestions and can be varied. Generally, components such as graphs and tables expand and contract proportionally, while components such as buttons, scrollbars, dice, and coins are fixed in size.
The text area below gives the code for this object, so that you can browse the constructors, methods, and properties of the object. Of course, this source file is part of objects.zip, which contains the source and resource files for all objects in all three packages.