pycopancore
pycopancore copied to clipboard
[generic_imitation] setting `imi_p_imitate` for multiple source/target values does not work
Setting together as in
imi_p_imitate = { 'ord': {
((1,2,), (5,)): 1.0,
}
does not yield any spreading, whilst setting separately
imi_p_imitate = { 'ord': {
((1,), (5,)): 1.0,
((2,), (5,)): 1.0,
}
does.
Edit: combining, i.e.
imi_p_imitate = { 'ord': {
((1,2), (5,)): 1.0,
((2,), (5,)): 1.0,
}
yields only a change from 2 → 5, suggesting the input from ((1,2), (5,)): 1.0,
is ignored / not parsed correctly.
Example config to reproduce:
culture = M.Culture(
imi_rate = {
#'bool': 10000, # -> 10000 updates
'ord': 1000, # *10 in batch -> 10000 updates
# 'pair': 200, # *~50 in batch -> 10000 updates
'*': 0,
},
imi_type = 'complex',
imi_batch_n = {'bool': 1, 'ord': 10},
imi_p_in_batch = {'pair': 0.5},
imi_network = M.Culture.acquaintance_network,
imi_p_neighbor_drawn = {'bool': 1.0, 'pair': 1.0},
imi_n_neighbors_drawn = {'ord': 5},
imi_rel_threshold = {'bool': {
((False,),(True,)): 0.4,
((True,),(False,)): 0.8
}},
imi_abs_threshold = {'ord': 1, 'pair': 0},
imi_include_own_trait = {'pair': True, '*': False},
imi_delta = {'pair': 10.0}, # evaluation will be done by Individual.imi_evaluate_pair
imi_p_imitate = {'pair': 1.0, 'bool': {
((False,),(True,)): 0.9,
((True,),(False,)): 0.7
},
'ord': {
((1,), (5,)): 1.0,
((2,), (5,)): 1.0,
}
} # for 'ord', the value is set by Cell.imi_p_imitate_ord
)
Additionally in simple.py
, the function Cell.imi_p_imitate_ord
needs to be replaced by pass
of course.
Edit: Tested on issue_152 branch. #156