import lib.ngagent as ngagent

"""
Explanation: Agents
Agents are objects having a strategy, a vocabulary, and an ID (this last attribute is not important for the moment).
End of explanation
"""


ag_cfg = {
    'agent_id':'test',
    'voc_cfg':{
        'voc_type':'sparse_matrix',
        'M':5,
        'W':10
        },
    'strat_cfg':{
        'strat_type':'naive',
        'voc_update':'Minimal'
        }
    }

testagent=ngagent.Agent(**ag_cfg)
testagent

print(testagent)

import random
M=ag_cfg['voc_cfg']['M']
W=ag_cfg['voc_cfg']['W']
for i in range(0,15):
    k=random.randint(0,M-1)
    l=random.randint(0,W-1)
    testagent._vocabulary.add(k,l,1)
print(testagent)

"""
Explanation: Let's create an agent. Vocabulary and strategy are created at the same time.
End of explanation
"""


testagent.visual()
testagent.visual("hom")

testagent.visual()
testagent.visual("syn")

testagent.visual()
testagent.visual("pick_mw",iterr=500)

testagent.visual()
testagent.visual("guess_m",iterr=500)

testagent.visual()
testagent.visual("pick_w",iterr=500)

"""
Explanation: We can get visuals of agent objects from strategy and vocabulary visuals, with same syntax.
End of explanation
"""


