Class District

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
                    |
                    +--District

public class District
extends java.util.Vector

The District class holds all of our Voters, Candidates, and Reps. Voters are created during construction of the District. Candidates are placed in a Candidate Pool and drawn from the Voters. The District is also responsible for conducting votes and electing Reps to Congress.

See Also:
Serialized Form

Field Summary
 Pool CandidatePool
           
 int center
           
 Rep CurrentRep
           
 Congress Government
           
 double maxSeparation
           
 int[] median
           
 int medianUtility
           
 java.lang.String name
           
 int numberOfBills
           
 int policies
           
 int positions
           
 int SPREAD
           
 int tagLength
           
 int termLimit
           
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
District(int numVoters, int policies, int numberOfBills, int positions, int tagLength, java.lang.String districtName, int termLimit)
           
 
Method Summary
 Candidate ConductVote()
           
 Rep ElectRep()
           
 void FindCandidates()
           
 double findCentrality(Individual person)
           
 void findMedian()
           
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

policies

public int policies

numberOfBills

public int numberOfBills

positions

public int positions

tagLength

public int tagLength

termLimit

public int termLimit

CandidatePool

public Pool CandidatePool

name

public java.lang.String name

CurrentRep

public Rep CurrentRep

Government

public Congress Government

maxSeparation

public double maxSeparation

median

public int[] median

medianUtility

public int medianUtility

center

public int center

SPREAD

public int SPREAD
Constructor Detail

District

public District(int numVoters,
                int policies,
                int numberOfBills,
                int positions,
                int tagLength,
                java.lang.String districtName,
                int termLimit)
Method Detail

findMedian

public void findMedian()

findCentrality

public double findCentrality(Individual person)

FindCandidates

public void FindCandidates()

ConductVote

public Candidate ConductVote()

ElectRep

public Rep ElectRep()