class prisoner extends Object { int myID; boolean myDecision; boolean myPreviousDecision; int myPay; boolean myCoop; String myStrat; String myTrust; int myPos; /*THE DEFAULT DECISION WILL BE TO BETRAY... //A PRISONER KEEPS TRACK OF HIS PAYMENT AND HIS DECISION. //PRISONER CHANGES 11.6.07 //Added ability to determine cooperation //11.30.07 Why didn't I think of this sooner? The Strategies will be represented by names. THEN, it will actually be hard coded into the main program. I'm an idiot... //12.7.07 Today I have decided to change string names to numbers...And yes, I am moving rather slowly //1.4.08 Okay, now that my memory's refreshed, I should finish up the 'previousDecision' stuff here. */ public prisoner() { myID=-1; myDecision=false; myPay=0; myCoop=false; myStrat="NULL";; myPreviousDecision=false; } public prisoner(int ID) { myID=ID; myDecision=false; myPay=0; myCoop=false; myStrat="NULL"; myPreviousDecision=false; } public prisoner(boolean Decision) { myID=-1; myDecision=Decision; myPay=0; myStrat="NULL"; myPreviousDecision=false; } public prisoner(int ID, boolean Decision) { myID=ID; myDecision=Decision; myPay=0; myStrat="NULL"; myPreviousDecision=false; } int getID() { return myID; } boolean getDecision() { return myDecision; } boolean getPreviousDecision() { return myPreviousDecision; } boolean getCoop() { return myCoop; } int getPay() { return myPay; } int getPos() { return myPos; } String getStrat() { return myStrat; } void setDecision(boolean newDecision) { myDecision=newDecision; } void setPay(int payment) { myPay=payment; } void setCoop(boolean newCoop) { myCoop=newCoop; } void setStrat(String newStrat) { myStrat=newStrat; } void setPreviousDecision(boolean newDecision) { myPreviousDecision=newDecision; } }