2.2 Simulation algorithm

NS Natalia Szostak
JS Jaroslaw Synak
MB Marcin Borowski
SW Szymon Wasik
JB Jacek Blazewicz
request Request a Protocol
ask Ask a question
Favorite

The multi-agent simulation algorithm used to simulate the RP system is presented below. Each replicase and parasite is represented by a single agent in the simulation. When the agent is created, its remaining life time (RLT) is initialized random (see Eq 2), and during each simulation iteration, the time is decreased. When the complex is dissociated, the time does not have to be recalculated because of memoryless properties (see Section 2.4). There are a maximal number of allowed neighbors for each agent. If this is exceeded, the agent is removed due to a lack of resources. During each replication event, there is a certain probability of a mutation to agent properties with regard to agent affinity towards attributes or the probability of being in a folded state. The detailed algorithm is presented in the below list 1.

Algorithm 1 Our algorithm.

1: Initialize the simulation.

2:  Initialize the number and positions of the agents from a file or randomly.

3:  Initialize all replicases with equal aR and lR values.

4:  Initialize all parasites with equal aP and lP values.

5: while ((simulation time < time limit) AND (there are both parasites and replicases (complexed or uncomplexed) present)) do

6:  Increase the simulation time by Δt.

7:  Decrease the RLT time for each agent (complexes and uncomplexed).

8:  for all uncomplexed agents with the RLT = 0 do

9:   Remove the agents.

10:  end for

11:  Randomize the order of all agents.

12:  for all agent xi do

13:   if xi is complex AND RLT(xi) = 0 then

14:    Dissociate agents into two uncomplexed agents with the same position as the complex.

15:   end if

16:   for all agent that overlaps xi (see Eq 3) do

17:    Add it to the set of neighbors N

18:   end for

19:   if |N|>Nmax then

20:    remove agent xi from the simulation

21:   end if

22:   Randomize the order of N.

23:   Move xi (see Eq 1).

24:   if xi is complex then

25:    Decrease the replication time (TTR).

26:    if TTR = 0 then

27:     Create new agent x′ equal to the template from complex xi.

28:     Mutate x′.

29:     Dissociate xi:

30:      Create agents t and r based on the complexed template and replicase.

31:      Copy the position of xi to t and r.

32:      Restore the RLT(r) and RLT(t) values from the moment when the complex was created.

33:      Remove xi from the simulation.

34:    end if

35:   else

36:    for all njN do

37:     if (nj is uncomplexed) AND (nj OR xi is replicase) AND CheckReactionProbability(see Eq 4) then

38:      Create complex x′.

39:      Randomly initialize TTR(x′) (see Eq 2).

40:      Randomly initialize RLT(x′) (see Eq 2).

41:      Initialize the position of x′ as the average position of nj and xi.

42:      Remove nj and xi from the simulation.

43:     end if

44:    end for

45:   end if

46:  end for

47: end while

Do you have any questions about this protocol?

Post your question to gather feedback from the community. We will also invite the authors of this article to respond.

post Post a Question
0 Q&A