Module TwoPartyLegislature :: Class TwoPartyAgent
[hide private]
[frames] | no frames]

Class TwoPartyAgent

source code

Agent class taking either a 'liberal' or 'conservative' party and ideology

Instance Methods [hide private]
 
__init__(self, ideology_input=None, tolerance_function=None)
Class variables given outside the class init
source code
 
get_record(self)
returns agent voting record
source code
 
get_ideology(self)
returns agent ideology
source code
 
get_tolerance(self)
returns agent adjusted tolerance
source code
 
get_utility(self)
returns agent utility score
source code
 
get_id(self)
returns agent ID
source code
 
get_party(self)
returns agent party (0=liberal, 1=conservative)
source code
 
set_id(self, agent_id)
Assign agent ID
source code
 
set_utility(self, new_utility)
Assign agent a new utility
source code
 
add_record(self, bill_num, vote)
Add to agent voting record
source code
 
info(self, print_to=sys.stdout)
Prints key agent information
source code
Class Methods [hide private]
 
_determine_party(cls, ideology_input)
Return the party of an agent based on their ideology
source code
Static Methods [hide private]
 
_generate_ideology()
generate random ideology value
source code
Class Variables [hide private]
  LIBERAL_PARTY = 0
  CONSVRT_PARTY = 1
  PARTIES = (0, 1)