tac.agents.participant.v1.examples package

Submodules

tac.agents.participant.v1.examples.baseline module

This module contains a baseline agent implementation for TAC.

class tac.agents.participant.v1.examples.baseline.BaselineAgent(name: str, oef_addr: str, oef_port: int, strategy: tac.agents.participant.v1.base.strategy.Strategy, expected_version_id: str, agent_timeout: float = 1.0, max_reactions: int = 100, services_interval: int = 10, pending_transaction_timeout: int = 30, dashboard: Optional[tac.gui.dashboards.agent.AgentDashboard] = None, private_key_pem: Optional[str] = None)

Bases: tac.agents.participant.v1.agent.ParticipantAgent

A baseline agent implementation for TAC.

tac.agents.participant.v1.examples.baseline.main(name: str = 'baseline_agent', oef_addr: str = '127.0.0.1', oef_port: int = 10000, agent_timeout: float = 1.0, max_reactions: int = 100, register_as: str = 'both', search_for: str = 'both', is_world_modeling: bool = False, services_interval: int = 5, pending_transaction_timeout: int = 30, private_key_pem: Optional[str] = None, rejoin: bool = False, dashboard: bool = False, visdom_addr: str = '127.0.0.1', visdom_port: int = 8097, expected_version_id: str = '3971')

Launch a baseline agent.

Main entrypoint for starting a baseline agent. Please run the module with hte ‘–help flag’ to get more details about the parameters.

tac.agents.participant.v1.examples.strategy module

This module contains a baseline implementation of the abstract strategy class defining an agent’s strategy for the TAC.

class tac.agents.participant.v1.examples.strategy.BaselineStrategy(register_as: tac.agents.participant.v1.base.strategy.RegisterAs = <RegisterAs.BOTH: 'both'>, search_for: tac.agents.participant.v1.base.strategy.SearchFor = <SearchFor.BOTH: 'both'>, is_world_modeling: bool = False)

Bases: tac.agents.participant.v1.base.strategy.Strategy

This class defines a baseline strategy for the agent.

demanded_good_pbks(good_pbks: List[str], current_holdings: List[int]) → Set[str]

Generate a set of good public keys which are demanded.

Parameters
  • good_pbks – a list of good public keys

  • current_holdings – a list of current good holdings

Returns

a set of public keys

demanded_good_quantities(current_holdings: List[int]) → List[int]

Generate a list of quantities which are demanded.

Parameters

current_holdings – a list of current good holdings

Returns

a list of quantities

get_proposals(good_pbks: List[str], current_holdings: List[int], utility_params: List[float], tx_fee: float, is_seller: bool, world_state: Optional[tac.agents.participant.v1.base.states.WorldState]) → List[aea.protocols.oef.models.Description]

Generate a proposals from the seller/buyer.

Parameters
  • good_pbks – a list of good public keys

  • current_holdings – a list of current good holdings

  • utility_params – a list of utility params

  • tx_fee – the transaction fee

  • is_seller – Boolean indicating the role of the agent

  • world_state – the world state module

Returns

a list of proposals in Description form

supplied_good_pbks(good_pbks: List[str], current_holdings: List[int]) → Set[str]

Generate a set of good public keys which are supplied.

Parameters
  • good_pbks – a list of good public keys

  • current_holdings – a list of current good holdings

Returns

a set of public keys

supplied_good_quantities(current_holdings: List[int]) → List[int]

Generate a list of quantities which are supplied.

Parameters

current_holdings – a list of current good holdings

Returns

a list of quantities

Module contents

This module contains baseline implementations of agents and strategies for TAC.