Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing custom agents and bootstrapping #6

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pardianabele
Copy link
Member

Added tests for the cases of curtom agent sets and PAT bootstraping. Also a small chnage in variable names in the config.init

Added tests for the cases of curtom agent sets and PAT bootstraping. Also a small chnage in variable names in the config.init
@mariopaolucci
Copy link
Contributor

Hello Anabele,

I was testing and I found that activating random agents (change the value in

agents_with_random_attributes = False
) makes the test crash in create_pat at step 3. if I do

        if creator:
            print("creator: ", creator)
            intention = creator['creator_intention']
           ....

The program runs but the test fails. I attribute this to the agents/agents[0] issue. Can you reproduce/ do you agree?

I suggest we solve that before moving on - I think we're just adding agents in the list the wrong way. Look at the list of agents; some of them are added as a dict, some as a list containing a dict.

[{'uuid': UUID('ffd530bd-100f-421b-83c3-eee38e977f34'),
  'type': 'A',
  'name': 5,
  'token_wallet': {'reputation': 0},
  'activity': 0,
  'own_PATs': 0,
  'claimer': 'opportunistic',
  'claimer_PAT_intention': 'malicious',
  'voter': 'assessment',
  'creator_intention': 'malicious',
  'creator_design': 'careless'},
 {'uuid': UUID('c2c906f8-46a8-452e-bc1c-ca29679fd321'),
  'type': 'A',
  'name': 6,
  'token_wallet': {'reputation': 0},
  'activity': 0,
  'own_PATs': 0,
  'claimer': 'opportunistic',
  'claimer_PAT_intention': 'malicious',
  'voter': 'assessment',
  'creator_intention': 'malicious',
  'creator_design': 'careless'},
 {'uuid': UUID('d5bb1c9a-98a4-4d25-94b0-5080bb96d4b5'),
  'type': 'A',
  'name': 7,
  'token_wallet': {'reputation': 0},
  'activity': 0,
  'own_PATs': 0,
  'claimer': 'opportunistic',
  'claimer_PAT_intention': 'malicious',
  'voter': 'assessment',
  'creator_intention': 'malicious',
  'creator_design': 'careless'},
 {'uuid': UUID('b7414dbe-6769-4975-9553-e81eb3e44f62'),
  'type': 'A',
  'name': 8,
  'token_wallet': {'reputation': 0},
  'activity': 0,
  'own_PATs': 0,
  'claimer': 'opportunistic',
  'claimer_PAT_intention': 'malicious',
  'voter': 'assessment',
  'creator_intention': 'malicious',
  'creator_design': 'careless'},
 {'uuid': UUID('eb66a1fd-944b-423e-a466-7c5ee99b3dbc'),
  'type': 'A',
  'name': 9,
  'token_wallet': {'reputation': 0},
  'activity': 0,
  'own_PATs': 0,
  'claimer': 'opportunistic',
  'claimer_PAT_intention': 'malicious',
  'voter': 'assessment',
  'creator_intention': 'malicious',
  'creator_design': 'careless'},
 {'uuid': UUID('b8d248b9-94cb-4f26-a108-a6ff24cdbc77'),
  'type': 'A',
  'name': 10,
  'token_wallet': {'reputation': 0},
  'activity': 0,
  'own_PATs': 0,
  'claimer': 'opportunistic',
  'claimer_PAT_intention': 'opportunistic',
  'voter': 'assessment',
  'creator_intention': 'opportunistic',
  'creator_design': 'careless'},
 {'uuid': UUID('56f665f1-a08f-4426-972e-457130828db1'),
  'type': 'A',
  'name': 11,
  'token_wallet': {'reputation': 0},
  'activity': 0,
  'own_PATs': 0,
  'claimer': 'opportunistic',
  'claimer_PAT_intention': 'opportunistic',
  'voter': 'assessment',
  'creator_intention': 'opportunistic',
  'creator_design': 'careless'},
 {'uuid': UUID('f30f6af8-ad19-4510-a20b-2cd741d86857'),
  'type': 'A',
  'name': 12,
  'token_wallet': {'reputation': 0},
  'activity': 0,
  'own_PATs': 0,
  'claimer': 'opportunistic',
  'claimer_PAT_intention': 'opportunistic',
  'voter': 'assessment',
  'creator_intention': 'opportunistic',
  'creator_design': 'careless'},
 {'uuid': UUID('2f716bcd-4958-474c-b950-cb827c269835'),
  'type': 'A',
  'name': 13,
  'token_wallet': {'reputation': 0},
  'activity': 0,
  'own_PATs': 0,
  'claimer': 'opportunistic',
  'claimer_PAT_intention': 'opportunistic',
  'voter': 'assessment',
  'creator_intention': 'opportunistic',
  'creator_design': 'careless'},
 [{'uuid': UUID('d6837a05-2fa5-470d-8b89-4ea23f02e063'),
   'type': 'A',
   'name': 4,
   'token_wallet': {'reputation': 0, 1: 4, 0: 1, 2: 2},
   'activity': 6,
   'own_PATs': 0,
   'claimer': 'opportunistic',
   'claimer_PAT_intention': 'noble',
   'voter': 'assessment',
   'creator_intention': 'noble',
   'creator_design': 'careless'}],
 [{'uuid': UUID('b3535670-2e79-46ac-8e5a-72eafa8d3c65'),
   'type': 'A',
   'name': 0,
   'token_wallet': {'reputation': 0, 1: 2, 2: 2},
   'activity': 2,
   'own_PATs': 0,
   'claimer': 'opportunistic',
   'claimer_PAT_intention': 'noble',
   'voter': 'assessment',
   'creator_intention': 'noble',
   'creator_design': 'careless'}],
 [{'uuid': UUID('23326a17-5a4e-4eed-9848-7e0ba132c162'),
   'type': 'A',
   'name': 3,
   'token_wallet': {'reputation': 0, 0: 2, 1: 1, 2: 1},
   'activity': 4,
   'own_PATs': 0,
   'claimer': 'opportunistic',
   'claimer_PAT_intention': 'noble',
   'voter': 'assessment',
   'creator_intention': 'noble',
   'creator_design': 'careless'}],
 [{'uuid': UUID('7e18dee2-b2ab-4ebf-a8dd-f785f691e94c'),
   'type': 'A',
   'name': 1,
   'token_wallet': {'reputation': 0, 1: 4, 0: 4, 2: 1},
   'activity': 9,
   'own_PATs': 0,
   'claimer': 'opportunistic',
   'claimer_PAT_intention': 'noble',
   'voter': 'assessment',
   'creator_intention': 'noble',
   'creator_design': 'careless'}],
 [{'uuid': UUID('65d65fa0-3984-4a9d-8d21-c6e2f40588b9'),
   'type': 'A',
   'name': 2,
   'token_wallet': {'reputation': 0, 1: 3, 0: 2},
   'activity': 5,
   'own_PATs': 0,
   'claimer': 'opportunistic',
   'claimer_PAT_intention': 'noble',
   'voter': 'assessment',
   'creator_intention': 'noble',
   'creator_design': 'careless'}]]

I'm waiting for instructions - want me to track down the bug, or you want to do it yourself?

Cheers

Mario

…ed some of the functions meant to deal with it.
@mariopaolucci
Copy link
Contributor

Ok, that's what I could do - it was in the agent factory.

I have streamlined where I read, and removed quite a bit of clutter and unused code, but there could be more. Please double check everything!

@benjaminaaron benjaminaaron changed the base branch from master to main June 17, 2020 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants