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

[generic_imitation] setting imi_p_imitate for multiple source/target values does not work #162

Open
leander-j opened this issue Dec 15, 2021 · 1 comment
Assignees
Labels

Comments

@leander-j
Copy link

leander-j commented Dec 15, 2021

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

@leander-j
Copy link
Author

More:

        'ord': {
            ((1,), (5,)): 1.0,
            ('*', '*'): 1.0,
            }

does yield the exact same result as

        'ord': {
            ((1,2), (5,)): 1.0,
            ('*', '*'): 1.0,
            }

but not as

        'ord': 1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants