-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from pedro-andrade-inpe/master
update to beta-5
- Loading branch information
Showing
17 changed files
with
85 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
Random{seed = 12345} | ||
|
||
import("sysdyn") | ||
|
||
y = Yeast{} | ||
|
||
y:run() | ||
|
||
y.chart:save("yeast.bmp") | ||
clean() | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- A yeast growth model. | ||
-- @arg data.cells The initial number of cells. The default value is 9.6. | ||
-- @arg data.capacity The total capacity of the environment. The default value is 665. | ||
-- @arg data.rate The growth rate of the cells. The default value is 1.1. | ||
-- @arg data.finalTime The final simulation time. The default value is 9. | ||
-- @output finalCells A vector with the quantity of cells in each time step. | ||
-- @image yeast.bmp | ||
Yeast = Model{ | ||
cells = 9.6, | ||
capacity = 665.0, | ||
rate = Choice{min = 0, max = 3.5, default = 1.1}, | ||
finalTime = 9, | ||
init = function(model) | ||
model.chart = Chart{ | ||
target = model, | ||
select = {"cells"} | ||
} | ||
|
||
model.finalCells = {[0] = model.cells} | ||
|
||
model.timer = Timer{ | ||
Event{action = function() | ||
model.cells = model.cells + model.cells * model.rate * (1 - model.cells / model.capacity) | ||
|
||
if model.cells > model.capacity then | ||
model.cells = model.capacity | ||
end | ||
|
||
table.insert(model.finalCells, model.cells) | ||
end}, | ||
Event{action = model.chart} | ||
} | ||
end | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
-- Test file for Yeast.lua | ||
-- Author: Gilberto Camara and Pedro R. Andrade | ||
|
||
return{ | ||
Yeast = function(unitTest) | ||
local model = Yeast{} | ||
|
||
model:run() | ||
|
||
unitTest:assertSnapshot(model.chart, "Yeast-chart-1.bmp", 0.05) | ||
end, | ||
} | ||
|