Older
-
-
-
-
-
-
issue 1
(Agent utility function needs to be generalized) reported by agconway
-
-
GCS_experiment.zip (The 'greedy conservative' simulation) file uploaded by agconway
-
Labels:
Featured
Type-Source
Labels:
Featured
Type-Source
-
r45
(MAJOR UPDATE: The TwoPartyAgent and Committee classes have ...) committed by agconway
- MAJOR UPDATE: The TwoPartyAgent and Committee classes have undergone substantial change. These
changes have been to support the "greedy conservative" experiment.
1. The framework now accounts for how much time (in voting periods) it is taking agents to pass a
bill
2. Agent utility is now based on a function that accounts for this time, and in the current
formulation, the agents are punished for taking longer
3. Agents can look ahead to calculate the amount of utility lost by holding out from voting
4. Agent's internal voting mechanism has become more intricate, and will likely need additional
testing.
MAJOR UPDATE: The TwoPartyAgent and Committee classes have undergone substantial change. These
changes have been to support the "greedy conservative" experiment.
1. The framework now accounts for how much time (in voting periods) it is taking agents to pass a
bill
2. Agent utility is now based on a function that accounts for this time, and in the current
formulation, the agents are punished for taking longer
3. Agents can look ahead to calculate the amount of utility lost by holding out from voting
4. Agent's internal voting mechanism has become more intricate, and will likely need additional
testing.
-
r44
(Added ability to predefine committee members in Committee cl...) committed by agconway
- Added ability to predefine committee members in Committee class.
Added ability to predefine committee members in Committee class.
-
r43
(Added function to Bill class that will tell user if the Bill...) committed by agconway
- Added function to Bill class that will tell user if the Bill passed
Added function to Bill class that will tell user if the Bill passed
-
r42
(Removed some debugging output from voting procedures.) committed by agconway
- Removed some debugging output from voting procedures.
Removed some debugging output from voting procedures.
-
r41
(Fixed major bug in TwoPartyAgent.vote that was causing agent...) committed by agconway
- Fixed major bug in TwoPartyAgent.vote that was causing agents with 100% probability of voting for a
bill to NOT vote for the bill. Agents now behave as intended, and no bill will ever receive 0
votes, as there will always be 1 agent for which there is a 100% probability of getting a YAY.
Fixed major bug in TwoPartyAgent.vote that was causing agents with 100% probability of voting for a
bill to NOT vote for the bill. Agents now behave as intended, and no bill will ever receive 0
votes, as there will always be 1 agent for which there is a 100% probability of getting a YAY.
-
r40
(Removed verbose print outputs from Agent class testing) committed by agconway
- Removed verbose print outputs from Agent class testing
Removed verbose print outputs from Agent class testing
-
r39
(Agent class now contains internal voting mechanism that retu...) committed by agconway
- Agent class now contains internal voting mechanism that returns Boolean. This voting mechanism has
two options:
1. Probabilistic - the probability an agent will vote YAY for a change in the status quo is based on
the distance a new bill is from the agent's ideology. This is defined as
1-distance(agent_ideology,new_ideology), meaning the shorter the distance, the higher the
probability. Probability is executed by a single draw from a uniform distribution of the [0.0,1.0].
This adds stochastic noise to voting, because agents will no longer vote by strictly maximizing
utility
2. Strict utility maximizing - agents will only vote YAY for bills that move the status quo closer
to their ideal points.
Agent class now contains internal voting mechanism that returns Boolean. This voting mechanism has
two options:
1. Probabilistic - the probability an agent will vote YAY for a change in the status quo is based on
the distance a new bill is from the agent's ideology. This is defined as
1-distance(agent_ideology,new_ideology), meaning the shorter the distance, the higher the
probability. Probability is executed by a single draw from a uniform distribution of the [0.0,1.0].
This adds stochastic noise to voting, because agents will no longer vote by strictly maximizing
utility
2. Strict utility maximizing - agents will only vote YAY for bills that move the status quo closer
to their ideal points.
-
r38
(Fixed a bug in the Committee class that was not creating eve...) committed by agconway
- Fixed a bug in the Committee class that was not creating even evenly divided committees when the
committee size was given as an even integer. The class now creates an evenly split committee was
the size is even, and a +1 advantage to the party in power when the committee size is odd.
Fixed a bug in the Committee class that was not creating even evenly divided committees when the
committee size was given as an even integer. The class now creates an evenly split committee was
the size is even, and a +1 advantage to the party in power when the committee size is odd.
-
r37
(Adding initial unit test case for the TwoPartyLegislature cl...) committed by MarkRoddy
- Adding initial unit test case for the TwoPartyLegislature class. More tests to follow.
Adding initial unit test case for the TwoPartyLegislature class. More tests to follow.
-
r36
(Fixed bug in TwoPartyAgent class constructor. Conservative ...) committed by MarkRoddy
- Fixed bug in TwoPartyAgent class constructor. Conservative agents are meant to subtract the
tolerance function result from the tolerance, and not add it as is the case of liberal agents. A
unit test has been added to check for this issue.
Fixed bug in TwoPartyAgent class constructor. Conservative agents are meant to subtract the
tolerance function result from the tolerance, and not add it as is the case of liberal agents. A
unit test has been added to check for this issue.
-
r35
(Added equals() function to the TwoPartyAgent class and overr...) committed by MarkRoddy
- Added equals() function to the TwoPartyAgent class and overrode the == and != operators. Also added
unit tests to check this functionality
Added equals() function to the TwoPartyAgent class and overrode the == and != operators. Also added
unit tests to check this functionality
-
r34
(Removed extranious white space from the makefile) committed by MarkRoddy
- Removed extranious white space from the makefile
Removed extranious white space from the makefile
-
r33
(Added new target 'dist' for creating distribution files. Cu...) committed by MarkRoddy
- Added new target 'dist' for creating distribution files. Currently this creates a zip of python
files in the current directory, but this can be expanded in the future to create other distributable
files such as eggs, deb, and rpm.
Added new target 'dist' for creating distribution files. Currently this creates a zip of python
files in the current directory, but this can be expanded in the future to create other distributable
files such as eggs, deb, and rpm.
-
r32
(Updated version number in the TwoPartyLegistlature module to...) committed by MarkRoddy
- Updated version number in the TwoPartyLegistlature module to reflect the current version. Also,
create standard module level variable __version__ to store this information.
Updated version number in the TwoPartyLegistlature module to reflect the current version. Also,
create standard module level variable __version__ to store this information.
-
r31
(Adding make file which contains targets for performing commo...) committed by MarkRoddy
- Adding make file which contains targets for performing common commands.
Adding make file which contains targets for performing common commands.
-
r30
(Placed code to be run inside a main() function. This allows...) committed by MarkRoddy
- Placed code to be run inside a main() function. This allows the api documentation to run over this
module. It also allows the code to be run via the interpreter.
Placed code to be run inside a main() function. This allows the api documentation to run over this
module. It also allows the code to be run via the interpreter.
-
r29
(Changed import of networkx. Now import the module and not en...) committed by MarkRoddy
- Changed import of networkx. Now import the module and not entities from it. This way, if UbiGraph
isn't installed yet an error will be observed at run time rather then compile time. In addition, it
will allow for command line options being used so that users can specify whether or not they have
this software installed.
Changed import of networkx. Now import the module and not entities from it. This way, if UbiGraph
isn't installed yet an error will be observed at run time rather then compile time. In addition, it
will allow for command line options being used so that users can specify whether or not they have
this software installed.
-
r28
(Converted function code comments to doc strings in the Bill ...) committed by MarkRoddy
- Converted function code comments to doc strings in the Bill class so that this information can be
made available in api documentation generation systems.
Converted function code comments to doc strings in the Bill class so that this information can be
made available in api documentation generation systems.
-
r27
(Added test fixtures for the get_record(), num_liberal_yays()...) committed by MarkRoddy
- Added test fixtures for the get_record(), num_liberal_yays(), and num_conservative_yays() functions
on the Bill class.
Added test fixtures for the get_record(), num_liberal_yays(), and num_conservative_yays() functions
on the Bill class.
-
r26
(Added arguments to the constructor of the Bill class so that...) committed by MarkRoddy
- Added arguments to the constructor of the Bill class so that the party, ideology, and id of the bill
can be specified at the creation time of an object.
Added arguments to the constructor of the Bill class so that the party, ideology, and id of the bill
can be specified at the creation time of an object.
-
r25
(Added test fixture for the new determine_party() method.) committed by MarkRoddy
- Added test fixture for the new determine_party() method.
Added test fixture for the new determine_party() method.
-
r24
(Seperated the process of determining the party of an agent b...) committed by MarkRoddy
- Seperated the process of determining the party of an agent based on their ideology into its own
function. This will allow subclasses to easily specify their own method of determing what party an
agent is in. For example, supporting more then two parties would require a change in how to
determine what party an agent is in.
Seperated the process of determining the party of an agent based on their ideology into its own
function. This will allow subclasses to easily specify their own method of determing what party an
agent is in. For example, supporting more then two parties would require a change in how to
determine what party an agent is in.
-
r23
(Refactored the TwoPartyAgent class constructor to only gener...) committed by MarkRoddy
- Refactored the TwoPartyAgent class constructor to only generate a random ideology input if not
specified caller instead of generating a party and a ideology input. This prevents the possiblity
of an agent having a ideology that does not match their party affiliation. While small, the
possiblity of this occuring exists in the previous desgin. Also, by placing the process of
generating the ideology in a seperate function, consumers of the class can override this function
and specify their own manner of generating ideology. For instance, to generate a set of agents in
which the ideology of those agents is scewed in favor of one party over another.
Refactored the TwoPartyAgent class constructor to only generate a random ideology input if not
specified caller instead of generating a party and a ideology input. This prevents the possiblity
of an agent having a ideology that does not match their party affiliation. While small, the
possiblity of this occuring exists in the previous desgin. Also, by placing the process of
generating the ideology in a seperate function, consumers of the class can override this function
and specify their own manner of generating ideology. For instance, to generate a set of agents in
which the ideology of those agents is scewed in favor of one party over another.
-
r22
(Converted 8 space tab translation to 4 space tab translation...) committed by MarkRoddy
- Converted 8 space tab translation to 4 space tab translation. 8 proved to be much too long.
Converted 8 space tab translation to 4 space tab translation. 8 proved to be much too long.
-
r21
(Converted tab characters to space characters to be uniform a...) committed by MarkRoddy
- Converted tab characters to space characters to be uniform across the file.
Converted tab characters to space characters to be uniform across the file.
-
r20
(Simplified code used to generate the ideology for an agent i...) committed by MarkRoddy
- Simplified code used to generate the ideology for an agent if it was not specified. Several pieces
of code were duplicated between the if statement that checked if the party of conservative or
liberal. The code has been changed so that only the conservative party is checked for, and if so
the list of samples is reversed (to scale above .5). This allows all the other lines of code to not
be repeated.
Simplified code used to generate the ideology for an agent if it was not specified. Several pieces
of code were duplicated between the if statement that checked if the party of conservative or
liberal. The code has been changed so that only the conservative party is checked for, and if so
the list of samples is reversed (to scale above .5). This allows all the other lines of code to not
be repeated.
-
r19
(Added option of passing a file like object to the TwoPartyAg...) committed by MarkRoddy
- Added option of passing a file like object to the TwoPartyAgent.info() function so that the
information can be printed to alternative destinations. By default the destination will be to
sys.stdout which means that the behavior of this function will not change for code already written
against it.
Added option of passing a file like object to the TwoPartyAgent.info() function so that the
information can be printed to alternative destinations. By default the destination will be to
sys.stdout which means that the behavior of this function will not change for code already written
against it.
-
r18
(Converted function and class comments into doc string so the...) committed by MarkRoddy
- Converted function and class comments into doc string so they may be consumed by API documentation.
Converted function and class comments into doc string so they may be consumed by API documentation.
-
r17
(Added 'constant' variables to represent the id's of the libe...) committed by MarkRoddy
- Added 'constant' variables to represent the id's of the liberal and conservative parties and
replaced hardcoded 1's and 0's with references to these constant variables in the TwoPartyAgent
class. This makes the code straight forward by explicitly stating in the code what party is being
assigned or queried rather then seeing a 0 or a 1 and having to worry about determining what party
is being referenced. This will also make it easier to add more parties in the future by adding more
party constants.
Added 'constant' variables to represent the id's of the liberal and conservative parties and
replaced hardcoded 1's and 0's with references to these constant variables in the TwoPartyAgent
class. This makes the code straight forward by explicitly stating in the code what party is being
assigned or queried rather then seeing a 0 or a 1 and having to worry about determining what party
is being referenced. This will also make it easier to add more parties in the future by adding more
party constants.
-
r16
(Fixed error in the Bill.info() function that did not properl...) committed by MarkRoddy
- Fixed error in the Bill.info() function that did not properly handle bills that had not yet been
voted upon. Also added new unit test to check for this error.
Fixed error in the Bill.info() function that did not properly handle bills that had not yet been
voted upon. Also added new unit test to check for this error.
-
r15
(Added initial unit test case for the Bill class. Test for n...) committed by MarkRoddy
- Added initial unit test case for the Bill class. Test for num_liberal_yays() and
num_conservative_yays() functions to be implemented shortly.
Added initial unit test case for the Bill class. Test for num_liberal_yays() and
num_conservative_yays() functions to be implemented shortly.
-
r14
(Added functions with TwoPartyAgent and TwoPartyLegislature c...) committed by agconway
- Added functions with TwoPartyAgent and TwoPartyLegislature class to return individual and aggregate
utilities respectively
Added functions with TwoPartyAgent and TwoPartyLegislature class to return individual and aggregate
utilities respectively
-
r13
(New simulation script based on additional functionality) committed by agconway
- New simulation script based on additional functionality
New simulation script based on additional functionality
-
r12
(Added 'get_ideologies' function to TwoPartyLegislature' clas...) committed by agconway
- Added 'get_ideologies' function to TwoPartyLegislature' class
Added 'get_ideologies' function to TwoPartyLegislature' class
-
r11
(Added missing 'majority' function to TwoPartyLegislature cla...) committed by agconway
- Added missing 'majority' function to TwoPartyLegislature class
Added missing 'majority' function to TwoPartyLegislature class
-
r10
(A new simulation test that takes advantage of the new Agent ...) committed by agconway
- A new simulation test that takes advantage of the new Agent and Committee functionality
A new simulation test that takes advantage of the new Agent and Committee functionality
-
r9
(1. Agents now seek to maximize 'utility', which is calculate...) committed by agconway
- 1. Agents now seek to maximize 'utility', which is calculated as the one-dimensional distance
between the agent's ideology and the status quo on any policy.
NOTE: In this version, agents no longer care about their 'tolerance'. Accounting for how agents
will try to maximize utility while having a tolerance will be part of the next iteration.
1. Complete overhaul of how a committee creates a bill. Committees are now given a 'status quo'
based on the median voter of the majority party (by default, can also be provided by nature or the
user). Then, an assigned 'agenda setter' agent decides if it is in its best interest to propose a
bill that changes the status quo, ie increases its utility. The new bill, however, must be
something that would be voted up by a majority of the committee members, as to inject committee
level compromise.
1. Agents now seek to maximize 'utility', which is calculated as the one-dimensional distance
between the agent's ideology and the status quo on any policy.
NOTE: In this version, agents no longer care about their 'tolerance'. Accounting for how agents
will try to maximize utility while having a tolerance will be part of the next iteration.
1. Complete overhaul of how a committee creates a bill. Committees are now given a 'status quo'
based on the median voter of the majority party (by default, can also be provided by nature or the
user). Then, an assigned 'agenda setter' agent decides if it is in its best interest to propose a
bill that changes the status quo, ie increases its utility. The new bill, however, must be
something that would be voted up by a majority of the committee members, as to inject committee
level compromise.
-
r8
(Added error check to ensure that id's are integer types and ...) committed by MarkRoddy
- Added error check to ensure that id's are integer types and a unit test to assert that the proper
exception is raised when this is not the case.
Added error check to ensure that id's are integer types and a unit test to assert that the proper
exception is raised when this is not the case.
-
r7
(Added test to check that an error is raised when adding a vo...) committed by MarkRoddy
- Added test to check that an error is raised when adding a vote to an agent when the vote is not 0 or
1 (as apposed to simply being outside the [0,1] range), and updated the check in the add_record()
method to check that the vote is either 0 or 1 only and not values in between.
Added test to check that an error is raised when adding a vote to an agent when the vote is not 0 or
1 (as apposed to simply being outside the [0,1] range), and updated the check in the add_record()
method to check that the vote is either 0 or 1 only and not values in between.
-
r6
(Completed initial version of TwoPartyAgentTests class for te...) committed by MarkRoddy
- Completed initial version of TwoPartyAgentTests class for testing the TwoPartyAgent class. Several
implementation details of this class need to be confirmed before this set of tests can be
'officially' completed.
Completed initial version of TwoPartyAgentTests class for testing the TwoPartyAgent class. Several
implementation details of this class need to be confirmed before this set of tests can be
'officially' completed.
-
r5
(Modified the TwoPartyAgent to properly take user input on th...) committed by agconway
- Modified the TwoPartyAgent to properly take user input on the 'ideology' value
Modified the TwoPartyAgent to properly take user input on the 'ideology' value
-
-
|