import java.util.*; import java.text.*; /********************************************************************* * Congress is where the Reps interact and enact legislation for the * whole Population at large. For each bill proposed, it is compared * to the status quo position, and all Reps vote. Through this voting * Reps accumulate a voting record and use this record to adapt the * partyTags of other Reps. ********************************************************************/ public class Congress extends Vector { public int[] statusQuo; // The current legislation public int[] newPolicy; // The new legislation public int[] proposedBills; // A collection of the bills proposed public int[] proposedIssues; // A collection of the issues proposed public int[][] proposedTags; // A collection of the tags proposed public int numOfBills; // The number of times bills are proposed public String[] didItPass; // A record of if a bill passed or not boolean OUT = false; // The constructor initializes all our variables public Congress(int policies, int positions, int numOfBills, int tagLength) { statusQuo = Utilities.vectorRand(policies, positions); newPolicy = new int[policies]; System.arraycopy(statusQuo, 0, newPolicy, 0, statusQuo.length); proposedBills = Utilities.vectorRand(numOfBills, policies); proposedIssues = Utilities.vectorRand(numOfBills, positions); proposedTags = new int[numOfBills][]; for (int i=0; i (size()/2)) { newPolicy[issue] = Author.ideology[issue]; didItPass[voteNumber] = "Y"; } else didItPass[voteNumber] = "N"; } // Prints out the similarity matrix between member of congress's tags public void similarityMatrix() { System.err.println(""); for (int i=0; i