|
uatlib
|
Class to define the default behavior of an agent. More...
#include <agent.hpp>
Public Types | |
| using | region_type = R |
Public Member Functions | |
| virtual auto | bid_phase (uint_t time, bid_fn bid, permit_public_status_fn status, int seed) -> void |
| virtual auto | ask_phase (uint_t time, ask_fn ask, permit_public_status_fn status, int seed) -> void |
| virtual auto | on_bought (const R ®ion, uint_t time, value_t value) -> void |
| virtual auto | on_sold (const R ®ion, uint_t time, value_t value) -> void |
| virtual auto | stop (uint_t time, int seed) -> bool=0 |
Class to define the default behavior of an agent.
All agent implementations should inherit from this class for a given region type. The region type should be a region_compatible type. Functions that are not implemented by the agent will have no effect. We suggest using override to ensure that no function signature mismatch occurs.
|
inlinevirtual |
Behavior of the agent during the ask phase.
| time | The current time step. |
| ask | A function that allows the agent to ask for a permit. |
| status | A function that returns the public status of a permit. |
| seed | A random seed. |
The function ask and status receive a region and a uint_t as arguments representing the location and time of the permit. The third argument of ask is the value the agent is willing to ask for the permit. The function ask returns true if the asking was successful, and false otherwise. The function status returns the public status of the permit with type permit_public_status_t.
override to ensure that no function signature mismatch occurs.
|
inlinevirtual |
Behavior of the agent during the bid phase.
| time | The current time step. |
| bid | A function that allows the agent to bid for a permit. |
| status | A function that returns the public status of a permit. |
| seed | A random seed. |
The function bid and status receive a region_compatible and a uint_t as arguments representing the location and time of the permit. The third argument of bid is the value the agent is willing to bid for the permit. The function bid returns true if the bidding was successful, and false otherwise. The function status returns the public status of the permit with type permit_public_status_t.
override to ensure that no function signature mismatch occurs.
|
inlinevirtual |
Callback function called when the agent successfully buys a permit.
| region | The region of the permit. |
| time | The time of the permit. |
| value | The value paid for the permit. |
override to ensure that no function signature mismatch occurs.
|
inlinevirtual |
Callback function called when the agent successfully sells a permit.
| region | The region of the permit. |
| time | The time of the permit. |
| value | The value received for the permit. |
override to ensure that no function signature mismatch occurs.
|
pure virtual |
Controls when the agent should stop.
Once this function returns true, the agent will be removed from the simulation.
| time | The current time step. |
| seed | A random seed. |