-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Washington's updates to calibration 0.3 and 0.4 - part 1 #200
Conversation
wsenafranca
commented
Dec 8, 2017
•
edited by pedro-andrade-inpe
Loading
edited by pedro-andrade-inpe
- MultipleRuns capture prints? #48
- remove graphics from multiLevel #159
- MultipleRuns and CellularSpace file possible bug #164
- Remove MultipleRuns:output #172
- MultipleRuns:free to remove unnecessary memory #189
…es in current directory and save output in another directory.
lua/MultipleRuns.lua
Outdated
print = function(...) | ||
local str = "" | ||
for _, v in ipairs({...}) do | ||
str = str .. v .. "\t" -- SKIP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not concatenate strings this way. It takes too much time. Use table.concat
instead.
lua/Utils.lua
Outdated
@@ -207,7 +209,7 @@ end | |||
-- } | |||
-- local parameters = {x = Choice{-100,- 1, 0, 1, 2, 100}, y = Choice{min = 1, max = 8, step = 1}} | |||
-- randomModel(myModel, parameters) | |||
function randomModel(tModel, tParameters) | |||
function randomModel(tModel, tParameters, skipRun) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better to never run the model here and remove this additional argument. Is it possible?
lua/MultipleRuns.lua
Outdated
@@ -142,17 +142,41 @@ local function checkParameters(origModel, origParameters) | |||
end | |||
|
|||
local function testAddFunctions(resultTable, addFunctions, data, m, summaryResult) | |||
forEachElement(m, function(attr, value, typ) | |||
if addFunctions[attr] ~= nil then | |||
customError("Values in model parameters or additional functions should not be repeated or have the same name.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error only occurs when one defines a function that is a value within the model. It is not possible to have repeated parameters. Therefore this error should be:
It is not possible to use function `attr` as output because this name is already an output value of the model.
lua/MultipleRuns.lua
Outdated
@@ -666,6 +682,8 @@ metaTableMultipleRuns_ = { | |||
-- @arg data.folderName Name or file path of the folder where the simulations output will be saved. | |||
-- Whenever the Model saves one or more files along its simulation, it is necessary to use this | |||
-- argument to guarantee that the files of each simulation will be saved in a different directory. | |||
-- @arg data.free If true, then the memory used by Model instances will be removed after their simulations. Only the observed | |||
-- properties of the model will be stored within MultipleRuns, (Default is false). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
within MultipleRuns. Default is false.
lua/MultipleRuns.lua
Outdated
@@ -666,6 +682,8 @@ metaTableMultipleRuns_ = { | |||
-- @arg data.folderName Name or file path of the folder where the simulations output will be saved. | |||
-- Whenever the Model saves one or more files along its simulation, it is necessary to use this | |||
-- argument to guarantee that the files of each simulation will be saved in a different directory. | |||
-- @arg data.free If true, then the memory used by Model instances will be removed after their simulations. Only the observed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after each simulation.
lua/MultipleRuns.lua
Outdated
@@ -280,6 +280,12 @@ local function redirectPrint(f) | |||
return log | |||
end | |||
|
|||
local function freeModel(model) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function should not be necessary.