In [1]:
import sys
#import seaborn as sns
sys.path.append("..")
import naminggamesal
import naminggamesal.ngvoc
%matplotlib inline
#sns.set(rc={'image.cmap': 'Purples_r'})

Experiments


In [2]:
import naminggamesal.ngsimu as ngsimu

Let's create an experiment


In [3]:
xp_cfg={
    'pop_cfg':{
        'voc_cfg':{
            'voc_type':'matrix',
            'M':5,
            'W':10
            },
        'strat_cfg':{
            'strat_type':'success_threshold',
            'voc_update':'Minimal'
            },
        'interact_cfg':{
            'interact_type':'speakerschoice'
            },
        'nbagent':10
        },
    'step':1
}

testexp=ngsimu.Experiment(**xp_cfg)
testexp


Out[3]:
<naminggamesal.ngsimu.Experiment at 0x7faf6c918850>

In [4]:
print(testexp)


T: 0
nbagent: 10
[[ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.]
 [ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.]
 [ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.]
 [ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.]
 [ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.]]

In [5]:
testexp.continue_exp(1)

In [6]:
print(testexp)
testexp.visual()


T: 1
nbagent: 10
[[ 0.   0.   0.   0.   0.   0.   0.   0.   0.   0. ]
 [ 0.   0.   0.   0.   0.   0.   0.   0.   0.2  0. ]
 [ 0.   0.   0.   0.   0.   0.   0.   0.   0.   0. ]
 [ 0.   0.   0.   0.   0.   0.   0.   0.   0.   0. ]
 [ 0.   0.   0.   0.   0.   0.   0.   0.   0.   0. ]]

Let's see the evolution of this vocabulary, after 20, 50 and 100 interactions.


In [7]:
Tvec=[20,50,100]
for i in range(100):
    testexp.continue_exp()
    #print str(testexp._poplist[-1])
for i in Tvec:
    testexp.visual(tmax=i)


We can graph measures on this population (more info on other possibile measures: Design_newMeasures.ipynb):


In [8]:
#testexp.graph("srtheo").show()
test=testexp.graph("srtheo")
test.show()



In [ ]:


In [9]:
testexp.graph("Nlinksurs").show()
testexp.graph("entropy").show()
testexp.graph("entropycouples").show()



In [ ]:


In [ ]: