Skip to content

Commit

Permalink
Updates to build package in version 0.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-andrade-inpe committed Jul 25, 2016
1 parent c599c3a commit c762422
Show file tree
Hide file tree
Showing 24 changed files with 50 additions and 26 deletions.
2 changes: 1 addition & 1 deletion description.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "0.6.1"
version = "0.6.2"
license = "GPL"
package = "sysdyn"
depends = "terrame (>= 2.0), sci (>= 0.3)"
Expand Down
Binary file added images/coffee.bmp
Binary file not shown.
10 changes: 10 additions & 0 deletions images/coffee.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

import("sysdyn")

c = Coffee{}

c:run()

c.chart:save("coffee.bmp")
clean()

Binary file added log/mac/Coffee-chart-1.bmp
Binary file not shown.
Binary file added log/mac/Daisyworld-chart-1.bmp
Binary file not shown.
Binary file added log/mac/Daisyworld-chart-2.bmp
Binary file not shown.
Binary file added log/mac/Daisyworld-chart-3.bmp
Binary file not shown.
Binary file added log/mac/Daisyworld-chart-4.bmp
Binary file not shown.
Binary file added log/mac/SIR-chart-1.bmp
Binary file not shown.
Binary file modified log/mac/population-growth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified log/mac/predator-prey-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified log/mac/predator-prey-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 0 additions & 6 deletions lua/ChaoticGrowth.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
--- A Model that describes a chaotic population growth.
-- @arg data.pop The initial population. The default value is 0.1.
-- @arg data.rate The rate that multiplies the population size in each time step. The degault value is 4.
-- @arg data.deltaTime A numeric value with the period to execute the changes of
-- the model. The default value is one.
-- @arg data.updateTime A numeric value with the period to update the charts.
-- The default value is one.
-- @arg data.finalTime The final time of the simulation. The default value is 300.
-- @arg data.view A table with two boolean elements, timeSeries and cobWeb (default true),
-- indicating whether a time series charts should be drawn.
-- @image chaotic-growth.bmp
ChaoticGrowth = Model{
pop = 0.10,
Expand Down
4 changes: 4 additions & 0 deletions lua/Daisyworld.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,15 @@ end
-- white according to their reflectivity or albedo.
-- @arg data.sunLuminosity Sun luminosity (this is the main variable of the model).
-- Values beteween 0.70 and 1.6 support life in Daisyworld.
-- @arg data.daisyArea The initial daisy area, which is the sum of white and
-- black areas. The default value is 0.673.
-- @arg data.planetArea The total area of the planet. The sum of the arguments
-- whiteArea, blackArea, and emptyArea should be equals to this value. The default value is 1.
-- @arg data.whiteArea The initial area of white daisies. The default value is 0.4.
-- @arg data.blackArea The initial area of black daisies. The default value is 0.273.
-- @arg data.emptyArea The initial empty area. The default value is 0.327.
-- @arg data.planetAlbedo The initial planet albedo, which is a weighted sum
-- based on the areas of daisies and their albedos.
-- @arg data.whiteAlbedo The albedo of white area. The default value is 0.75.
-- @arg data.blackAlbedo The albedo of black area. The default value is 0.25.
-- @arg data.soilAlbedo The albedo of empty area. The default value is 0.5.
Expand Down
2 changes: 0 additions & 2 deletions lua/LimitedGrowth.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
-- @arg data.rate The growth rate of the population.
-- @arg data.capacity The maximum amount of individuals.
-- @arg data.finalTime The number of simulation steps.
-- @arg data.view A table with a boolean element timeSeries (default true) indicating whether
-- a time series chart should be drawn.
-- @image limited-growth.bmp
LimitedGrowth = Model{
pop = 300,
Expand Down
2 changes: 0 additions & 2 deletions lua/MonoLake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ end
-- @arg data.evapRate The evaporation rate in feet/year.
-- @arg data.otherOut Other output of water from the lake in KAF/year.
-- @arg data.finalTime The final time of the simulation. The default value is 50.
-- @arg data.view A table with a boolean element timeSeries (default true) indicating whether
-- a time series chart should be drawn.
-- @image monolake.bmp
MonoLake = Model{
waterInLake = 2228.0, -- kiloAcre * feet
Expand Down
2 changes: 2 additions & 0 deletions lua/PredatorPrey.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ PredatorPrey = Model{
xAxis = "prey"
}

if model.period == 1 then model.period = nil end

model.timer = Timer{
Event{action = model, period = model.period},
Event{action = model.chart1},
Expand Down
6 changes: 0 additions & 6 deletions lua/RandomWalk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
-- time step. The available values are 0, 0.3, 0.5 (default), 0.7, 0.95, and 1.
-- @arg data.finalTime The final time of the simulation. It should be
-- at least 10. The default value is 100.
-- @arg data.deltaTime A numeric value with the period to execute the changes of
-- the model. The default value is one.
-- @arg data.updateTime A numeric value with the period to update the charts.
-- The default value is one.
-- @arg data.view A table with a boolean element timeSeries (default true) indicating whether
-- a time series chart should be drawn.
-- @image random-walk.bmp
RandomWalk = Model{
value = 0,
Expand Down
6 changes: 0 additions & 6 deletions lua/RoomTemperature.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
--- Simple model that simulates the temperature of three rooms.
-- @arg data.temperature1 The initial temperature of the first room. The default value is 80.
-- @arg data.temperature2 The initial temperature of the second room. The default value is 20.
-- @arg data.temperature3 The initial temperature of the third room. The default value is 5.
-- @arg data.exterior The temperature outside the rooms. The default value is 20.
-- @arg data.finalTime The final time of the simulation. The default value is 100.
-- @arg data.outside The temperature outside the room. The default value is 1.
-- @arg data.inside The temperature inside the room. The default initial value is 15.
Expand All @@ -12,8 +8,6 @@
-- @arg data.thermalInertia The percentage of input heat every time step according to the
-- difference between the temperature inside the room and the one selected in the thermostat.
-- The default value is 0.3.
-- @arg data.view A table with a boolean element timeSeries (default true) indicating whether
-- a time series chart should be drawn.
-- @image room-temperature.bmp
RoomTemperature = Model{
tempSet = 20.0,
Expand Down
13 changes: 13 additions & 0 deletions tests/Coffee.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-- Test file for Coffee.lua
-- Author: Gilberto Camara and Pedro R. Andrade

return{
Coffee = function(unitTest)
local model = Coffee{}

model:run()

unitTest:assertSnapshot(model.chart, "Coffee-chart-1.bmp")
end,
}

6 changes: 5 additions & 1 deletion tests/Daisyworld.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ return{
local model = Daisyworld{}

model:run()
unitTest:assertSnapshot(model.chart, "daisyworld.png")

unitTest:assertSnapshot(model.chart1, "Daisyworld-chart-1.bmp")
unitTest:assertSnapshot(model.chart2, "Daisyworld-chart-2.bmp")
unitTest:assertSnapshot(model.chart3, "Daisyworld-chart-3.bmp")
unitTest:assertSnapshot(model.chart4, "Daisyworld-chart-4.bmp")
end,
}

2 changes: 1 addition & 1 deletion tests/PopulationGrowth.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ return{
PopulationGrowth = function(unitTest)
local p = PopulationGrowth{}
p:run()
unitTest:assertEquals(p.growthChange, 0.8, 0.01)
unitTest:assertEquals(p.growthChange, 1, 0.01)
unitTest:assertSnapshot(p.chart, "population-growth.png")
end,
}
Expand Down
2 changes: 1 addition & 1 deletion tests/PredatorPrey.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ return{
local p = PredatorPrey{}
p:run()

unitTest:assertEquals(p.wolves, 41, 0.1)
unitTest:assertEquals(p.predator, 41, 0.1)
unitTest:assertSnapshot(p.chart1, "predator-prey-1.png")
unitTest:assertSnapshot(p.chart2, "predator-prey-2.png")
end,
Expand Down
13 changes: 13 additions & 0 deletions tests/SIR.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-- Test file for SIR.lua
-- Author: Gilberto Camara and Pedro R. Andrade

return{
SIR = function(unitTest)
local model = SIR{}

model:run()

unitTest:assertSnapshot(model.chart, "SIR-chart-1.bmp")
end,
}

0 comments on commit c762422

Please sign in to comment.