Skip to main content

Table 1 test_simulation pseudocode

From: The Multiscale Systems Immunology project: software for cell-based immunological simulation

procedure Initialize(n0) Number of leukocytes.
   DBConnStr ← (user, dbname, host, port, password) Initialize database.
   DBMaker ← DBMaker::Instance(DBConnStr)  
   Environment ← DBMaker.CreateEnvironment("testenv")  
   Source1 ← DBMaker.CreateCell("source") Creating and adding point sources to Environment.
   Source1.SetPosition(x1, y1, z1)  
   Environment.AddProp(Source1)  
   Source2 ← DBMaker.CreateCell("source")  
   Source2.SetPosition(x2, y2, z2)  
   Environment.AddProp(Source2)  
   Source3 ← DBMaker.CreateCell("source")  
   Source3.SetPosition(x3, y3, z3)  
   Environment.AddProp(Source3)  
   TNF ← DBMaker.CreateSolfac("tnf") Creating and adding soluble factors to environment.
   Environment.AddSolfac(TNF)  
   STNFR ← DBMaker.CreateSolfac("stnfr")  
   Environment.AddSolfac(TNF)  
   MCP1 ← DBMaker.CreateSolfac("mcp1")  
   Environment.AddSolfac(TNF)  
   Vasculature ← DBMaker.CreateVasculature("testvessel")  
   Environment.AddVasculature(Vasculature)  
   for i ← 1, n0 do Creating and adding leukocytes to environment.
Cell ← DBMaker.CreateCell("macrophage")  
Cell.SetPosition(Random(Environment.Bounds))  
Environment.AddCell(Cell)  
   end for  
end procedure  
procedure Main(dt, numsteps)  
   Initialize(n0)  
   Simulation ← new Simulation(Environment)  
   for i ← 1, numsteps do  
Simulation.Step(dt)  
Log(i, Simulation) Log of simulation results.
   end for  
end procedure