Similarity Adoption

class defSim.influence_sim.SimilarityAdoption.SimilarityAdoption(regime: str, **kwargs)

Bases: defSim.influence_sim.influence_sim.InfluenceOperator

The SimilarityAdoption influence operator implements a simple similarity-based probabilistic assimilation influence process much like Axelrod’s dissemination of culture model [Axelrod1997]. The sending agent selects a feature to communicate to the receiving agent. The receiving agent then adopts the trait of the sending agent with a probability ‘p’ proportional to the similarity between the agents. The functional relationship between similarity and p can be varied with the parameter ‘homophily’.

In principle, it is possible to use the SimilarityAdoption module with continuous attributes, but it is designed with categorical attributes in mind.

__init__(regime: str, **kwargs)
Parameters
  • regime – Either “one-to-one”, “one-to-many” or “many-to-one”

  • kwargs

    Additional parameters specific to the implementation of the InfluenceOperator. Possible parameters are the following: * float=0 homophily: A number \(>\) 0 that controls the shape of the influence curve.

    At 1, homophily is linear, like in [Axelrod1997] When the value for homophily \(>\) 1, agents prefer similar agents more and more. When 0 \(<\) homophily \(<\) 1, agents have less of a preference for more similar neighbors. However, the values for the probability of successful influence will always be the same at 0, .5, and 1 overlap. Respectively: 0, .5 and 1.

_abc_impl = <_abc._abc_data object>
spread_influence(network: networkx.classes.graph.Graph, agent_i: int, agents_j: List[int], dissimilarity_measure: defSim.dissimilarity_component.dissimilarity_calculator.DissimilarityCalculator, attributes: Optional[List[str]] = None, **kwargs) → bool
Parameters
  • network – The network in which the agents exist.

  • agent_i – the index of the focal agent that is either the source or the target of the influence

  • agents_j – A list of indices of the agents who can be either the source or the targets of the influence. The list can have a single entry, implementing one-to-one communication.

  • attributes – A list of the names of all the attributes that are subject to influence. If an agent has e.g. the attributes “Sex” and “Music taste”, only supply [“Music taste”] as a parameter for this function. The influence function itself can still be a function of the “Sex” attribute.

  • dissimilarity_measure – An instance of a DissimilarityCalculator.

Returns

true if agent(s) were successfully influenced

References

Axelrod1997(1,2)

Axelrod, R. (1997). The dissemination of culture: A model with local convergence and global polarization. *Journal of conflict resolution, 41*(2), 203-226.