Spread a characteristic between source and its links
Source:R/environment_network.R
network_spread.RdSpreading means that a certain information travels from the source_agent
to any other agents linked to this source. In an undirected environment,
this means that all agents linked to source_agent will receive a
characteristic with the given name (characteristic_name) and the given
value (characteristic_value). In a directed environment, by default,
only agents who point to the current source_agent will receive the
characteristic; this behavior can be changed via the two arguments
spread_via_indegree_links and spread_via_outdegree_links.
Usage
network_spread(
source_agent,
characteristic_name,
characteristic_value,
spread_via_indegree_links = TRUE,
spread_via_outdegree_links = FALSE,
overwrite = TRUE,
suppress_warnings = TRUE
)Arguments
- source_agent
the agent from whom the information should be spread
- characteristic_name
character string name of the characteristic to be set for the linked agent
- characteristic_value
value of the spread information (i.e., the characteristic to be set)
- spread_via_indegree_links
only applicable in directed graphs; if true (the default) then the information spreads via links where
source_agentis the target of the link (i.e., to whom others points)- spread_via_outdegree_links
only applicable in directed graphs; if true then the information spreads via links where
source_agentis also the source of the link (i.e., the starting point of an arrow); default here is false- overwrite
argument to be passed on to
set_characteristic(default is true meaning that the target characteristic will be overwritten)- suppress_warnings
argument to be passed on to
set_characteristic(default is true meaning that any overwritten characteristic will be done so silently/without raising any warnings)
See also
Other utilities:
get_characteristic(),
get_random_agent(),
get_variable(),
grid_get_free_neighboring_spots(),
grid_get_free_spots(),
grid_get_neighbors(),
grid_move(),
network_connect(),
network_get_neighbors(),
remove_agent(),
stop_abm()