The AEA TAC - trading agent competition - skills demonstrate an interaction between multiple AEAs in a game.
There are two types of AEAs:
tac_controllerwhich coordinates the game.
tac_participantAEAs which compete in the game. The
tac_participantAEAs trade tokens with each other to maximize their utility.
The scope of this specific demo is to demonstrate how the agents negotiate autonomously with each other while they pursue their goals by playing a game of TAC. Another AEA has the role of the controller and it's responsible for calculating the revenue for each participant and if the transaction messages are valid. Transactions are settled with the controller agent rather than against a public ledger.
There are two types of interactions: - between the participants and the controller, the game communication - between the participants, the negotiation
This diagram shows the communication between the various entities during the registration phase.
This diagram shows the communication between two AEAs and the controller. In this case, we have an AEA in the role of the seller, referred to as Seller_Agent. We also have an AEA in the role of the biyer, referred to as Buyer_Agent. During a given TAC, an AEA can be in both roles simultaneously in different bilateral interactions.
In the above case, the proposal received contains a set of good which the seller wishes to sell and a cost of them. The buyer AEA needs to determine if this is a good deal for them and if so, it accepts.
There is an equivalent diagram for seller AEAs set up to search for buyers and their interaction with AEAs which are registered as buyers. In that scenario, the proposal will instead, be a list of goods that the buyer wishes to buy and the price it is willing to pay for them.
Launch an OEF search and communication node
In a separate terminal, launch a local OEF search and communication node.
python scripts/oef/launch.py -c ./scripts/oef/launch_config.json
Keep it running for the following demo.
Create TAC controller AEA
In the root directory, fetch the controller AEA:
aea fetch fetchai/tac_controller:0.3.0 cd tac_controller aea install
Alternatively, create from scratch.
The following steps create the controller from scratch:
aea create tac_controller cd tac_controller aea add connection fetchai/oef:0.5.0 aea add skill fetchai/tac_control:0.3.0 aea install aea config set agent.default_connection fetchai/oef:0.5.0 aea config set agent.default_ledger ethereum
Create the TAC participant AEAs
In a separate terminal, in the root directory, fetch at least two participants:
aea fetch fetchai/tac_participant:0.4.0 --alias tac_participant_one aea fetch fetchai/tac_participant:0.4.0 --alias tac_participant_two cd tac_participant_two aea install
Alternatively, create from scratch.
In a separate terminal, in the root directory, create at least two tac participant AEAs:
aea create tac_participant_one aea create tac_participant_two
cd tac_participant_one aea add connection fetchai/oef:0.5.0 aea add skill fetchai/tac_participation:0.4.0 aea add skill fetchai/tac_negotiation:0.4.0 aea install aea config set agent.default_connection fetchai/oef:0.5.0 aea config set agent.default_ledger ethereum
cd tac_participant_two aea add connection fetchai/oef:0.5.0 aea add skill fetchai/tac_participation:0.4.0 aea add skill fetchai/tac_negotiation:0.4.0 aea install aea config set agent.default_connection fetchai/oef:0.5.0 aea config set agent.default_ledger ethereum
Update the game parameters in the controller
Navigate to the tac controller project, then use the command line to get and set the start time (set it to at least two minutes in the future):
aea config get vendor.fetchai.skills.tac_control.models.parameters.args.start_time aea config set vendor.fetchai.skills.tac_control.models.parameters.args.start_time '01 01 2020 00:01'
Run the AEAs
The CLI tool supports the launch of several agents at once.
For example, assuming you followed the tutorial, you can launch all the TAC agents as follows from the root directory:
aea launch tac_controller tac_participant_one tac_participant_two
You may want to try
option in order to run the agents
in the same process.
When you're finished, delete your AEAs:
aea delete tac_controller aea delete tac_participant_one aea delete tac_participant_two