Skip to content

create a way to run simulations #4

@jellegerbrandy

Description

@jellegerbrandy

We want to to experiments like:

we have 10.000 users, rep and tokens distributed random, and now 3.000 users all vote alike on each contribution. What happens?

The idea is to have a library/class that

  1. allows for for easy defining "scenarios"
  2. runs them quicky (seconds range)
  3. give some feedback while running (see below)
  4. allow for saving the results of the simulation in a CSV file for further analysis or presentation

example session

> python ./simulations/majority_attack.py
setting up ...
... add 1000 users ...
... user1 has 51% rep ...
STEP 1. user1 adds contribution and votes for it
--user ------------------------------
      | user1    | user2  |  .....
REP   | 0.5122   | 0.0001 | ...
TOK   | 12       | 1    | ...
----------------------------

STEP 2. user1 adds contribution and votes for it
--------------------------------
      | user1    | user2  |  .....
REP   | 0.5134   | 0.0001 | ...
TOK   | 11.56       | 1    | ...
----------------------------    

example csv output

STEP, DESCRIPTION, user1.rep, user1.tokens, user2.rep, user2.tokens, ...
1,user1 add contrib and votes for 1, 0.5122, 12, 0.0001,1
2,user1 add contrib and votes for 1, 0.5134, 11.56, 0.0001,1

example scenario definitoin

[to be done]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions