// ABSL Code for shape [name: type=ABMNSimModelParams id=shape1299581663459]
// Type in the simulation and model settings below
fAbmn_init_settings
lABS.fSet_variable ("random.seed", "1")
lABS.fSet_variable ("stop.at", "200")
lABS.fSet_variable ("distribution.uni_0_1", "double_uniform, 0, 1")
lABS.fSet_variable ("distribution.triangle", "triangle, 2, 5, 10")
lABS.fSet_variable ("node.rumoured.distribution", "uni_0_1")
lABS.fSet_variable ("node.rumoured.probability", ".01")
lABS.fSet_variable ("node.count", "10000")
lABS.fSet_variable ("shared.nodes.n", "20")
lABS.fSet_variable ("ke.model.m", "10")
lABS.fSet_variable ("initial.nodes", "10")
fend
tRumored_sum tRepast_tdatasource_int
iSum
bDo_count
oRepast_shared_context_tnodeNodes
fRumored_sum oRepast_shared_context_tnodeNodes
fend
fiGet_data
if (doCount) {
iSum = 0
bDo_count = false
}
return iSum
fend
fReset
bDo_count = true
fend
tend
tRumor_model
oRumored_sumRumor_sum
fRumor_model sProps_file
fend
fInit_schedule oRepast_schedule_runnerScheduleRunner
fend
fSpread_rumour
oRumored_sumRumor_sum.reset ()
fend
fCheck_for_stop
fend
fLog_rumour_sum
fend
fSynch_agents
fend
fInit_node
fend
fInit
fend
fProvide_content
fend
fProvide_edge_content
fend
fCreate_edge
fend
fUpdate_agent
fend
tend
tSpread
iId
tend
// ABSL Code for shape [name: DefiningAgent type=ABMNNetworkAgent id=shape1299581879362]
// Type in ABSL code here
tNode_content
iId
iProc
iType
bRumoured
tend
tEdgeContent
oNode_contentSource
oNode_contentTarget
tend
tNode tRepast_agent
iId
bRumoured
rProb
sDistName
fNode iP_id rP_prop sP_dist_name
fend
fInit rProb sDist
fend
fSet_rumoured bVal
bRumoured = bVal
fend
fbGet_rumoured
return bRumoured
fend
tend
// ABSL Code for shape [name: type=BPMNEventTypeStartTopLevel id=shape1299590585488]
// Type in ABSL code here
fiMain asArgs
lABS.fAbmn_init_settings ()
fModel_is_ready ()
fRumor_main (asArgs)
return 0
fend
// ABSL Code for shape [name: type=BPMNTaskTypeAbstract id=shape1299591920776]
// Type in ABSL code here
fRumour_model_initialize
iNum_nodes = lABS.fiGet_variable ("initial.nodes")
fend
fiGet_rumoured_count
// todo put the logic
return 1
fend
fiGet_population_count
return 4
fend
// ABSL Code for shape [name: type=BPMNGatewayXOREB id=shape1299666946751]
fbCheck_for_stop
// if number of rumoured nodes are half the population, stop
return fiGet_rumoured_count () > fiGet_population_count ()
fend
// ABSL Code for shape [name: type=BPMNEventTypeStartNonInt id=shape1299667126357]
fModel_is_ready
lABS.fSchedule_run (giSched_id)
fend
fSynch_agents
fend
fDataset_record
fend
fDataset_write
fend
fDataset_close
fend
fRumour_model_log_rumour_sum
fend
// ABSL Code for shape [name: type=BPMNTaskTypeAbstract id=shape1299668900222]
fInitialize_events
giSched_id = lABS.fiCreate_schedule ()
lABS.fSchedule_stop (giSched_id, lABS.frGet_variable ("stop.at"))
lABS.fiSchedule_event (giSched_id, 1, 1, fSpread_rumour)
lABS.fiSchedule_event (giSched_id, 1.05, 1, fSynch_agents)
lABS.fiSchedule_event (giSched_id, 1.1, 1, fDataset_record)
lABS.fiSchedule_event (giSched_id, 25.2, 25, fDataset_write)
lABS.fSchedule_end_event (giSched_id, fDataset_write)
lABS.fSchedule_end_event (giSched_id, fRumour_model_log_rumour_sum)
lABS.fSchedule_end_event (giSched_id, fDataset_close)
fend
// ABSL Code for shape [name: type=BPMNTaskTypeAbstract id=shape1300145874240]
fSpread_rumour
fend