emod_api.campaign module¶
You use this simple campaign builder by importing it, adding valid events via “add”, and writing it out with “save”.
-
emod_api.campaign.
reset
()¶
-
emod_api.campaign.
set_schema
(schema_path_in)¶ Set the (path to) the schema file. And reset all campaign variables. This is essentially a “start_building_campaign” function. :param schema_path_in. The path to a schema.json.:
- Returns
N/A.
-
emod_api.campaign.
add
(event, name=None, first=False)¶ Add a complete campaign event to the campaign builder. The new event is assumed to be a Python dict, and a valid event. The new event is not validated here. Set the first flag to True if this is the first event in a campaign because it functions as an accumulator and in some situations like sweeps it might have been used recently.
-
emod_api.campaign.
get_trigger_list
()¶
-
emod_api.campaign.
save
(filename='campaign.json')¶ Save ‘camapign_dict’ as ‘filename’.
-
emod_api.campaign.
get_adhocs
()¶
-
emod_api.campaign.
get_schema
()¶
-
emod_api.campaign.
get_recv_trigger
(trigger, old=False)¶ Get the correct representation of a trigger (also called signal or even event) that is being listened to.
-
emod_api.campaign.
get_send_trigger
(trigger, old=False)¶ Get the correct representation of a trigger (also called signal or even event) that is being broadcast.
-
emod_api.campaign.
get_event
(event, old=False)¶ Basic placeholder functionality for now. This will map new ad-hoc events to GP_EVENTs and manage that ‘cache’ If event in built-ins, return event, else if in adhoc map, return mapped event, else add to adhoc_map and return mapped event.