Liars lie is a game where a player tries to guess the number from a set of agents, some of them are liars, some of them are honest.
Launch agents and write their endpoints in agents.config
file. Currently agents are hardcoded to start on ports :13000 and above.
Positive integer. The truthful network value chosen by honest agents.
Positive integer.
Maximum value a lying agent can choose. A lying agent does not change its lying value during play
round once it is started.
Positive integer. Number of agents.
Positive float in the range of 0 <= liar-ratio <= 1. Ratio of liars in the lying agents from total set of agents (specified in num-agents).
Play one round of the game, outputiing a list of the values received by each agent and the concluded resulting value.
Stop all agents and delete agents.config
.
Extend the set of agents in the game.
Positive integer. The truthful network value chosen by honest agents.
Positive integer.
Maximum value a lying agent can choose. A lying agent does not change its lying value during play
round once it is started.
Positive integer. Number of new agents.
Positive float in the range of 0 <= liar-ratio <= 1. Ratio of liars in the lying agents from the new set of agents (specified in num-agents).
Play in expert mode. In this mode agents communicate with themselves to synchronize and choose one exact value between themselves.
Positive integer in the range of 0 <= num-agents <= total number of agents Player chooses with how many of the agents it wants to play. They are chosen randomly, thus the ratio of honest and lying is random.
Positive float in the range of 0 <= liar-ratio <= 1. Expected ratio from the player of lying agents in the subset chosen. It helps to predict which is the truthful value from the set of responses.
Kill a single agent.
Id of an agent.
Build the game. Required golang golang >=1.2.1.
scripts/build.sh
Run the game specifying multiple commands in one line. Include one argument, separating each command with |
.
Example usage:
scripts/run.sh 'start --value=42 --max-value=100 --num-agents=10 --liar-ratio=0.4 | play | stop'
scripts/run.sh 'start --value=20 --max-value=100 --num-agents=10 --liar-ratio=0.4 | play | extend --value=42 --max-value=100 --num-agents=5 --liar-ratio=0.2 | play | playexpert --num-agents=10 --liar-ratio=0.4 | play | kill --id=4 | playexpert --num-agents=10 --liar-ratio=0.4 | stop'
Alternatively, you can run them one by one by executing app/app
.
Example usage:
./app/app start --value=42 --max-value=100 --num-agents=100 --liar-ratio=0.2 & # wait for `ready` signal
./app/app playexpert --num-agents=40 --liar-ratio=0.6
./app/app playexpert --num-agents=50 --liar-ratio=0.6
./app/app playexpert --num-agents=80 --liar-ratio=0.3
./app/app kill --id=42
./app/app playexpert --num-agents=100 --liar-ratio=0.2
./app/app stop
scripts/unit_test.sh