Skip to content
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

Merged
merged 11 commits into from
Dec 16, 2017

Conversation

print = function(...)
local str = ""
for _, v in ipairs({...}) do
str = str .. v .. "\t" -- SKIP
Copy link
Member

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)
Copy link
Member

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?

@@ -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.")
Copy link
Member

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.

@@ -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).
Copy link
Member

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.

@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after each simulation.

@@ -280,6 +280,12 @@ local function redirectPrint(f)
return log
end

local function freeModel(model)
Copy link
Member

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.

@pedro-andrade-inpe pedro-andrade-inpe merged commit 09589a5 into TerraME:master Dec 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants