【发布时间】:2015-09-07 03:40:33
【问题描述】:
我正在尝试使用Julia 和UI Builder 从文档中获取基本的Forio Epicenter example。它看起来像这样:
#in MyModel.jl
module MyModel
# use the Epicenter Julia package
using Epicenter
# expose methods you want to call
# (e.g. using the Run API or Model Operation API,
# or the Model Operation property of a component in UI Builder)
export doubleIt
# expose variables you want to view or update
# (e.g. using the Run API or Model Variable API,
# or the Model Variable property of a component in UI Builder)
export parameters, result
# make exposed variables global
global parameters, result
# define variables that the end user will change as part of a complex type
type ParametersType
input1
input2
function ParametersType()
item = new()
item
end
end
function doubleIt()
global parameters
global result
result = parameters.input1 * 2
record(:result)
end
# other files in your model
include("Utils.jl")
include("OtherModelCalculations.jl")
end
我无法连接任何变量。当我制作“文本输入”组件并更改“模型变量”属性以匹配 Julia 变量(通过“导出”和“全局”公开)时,加载页面给了我
400 Bad Request
完整的 JSON 响应:
{"status":400,
"errors":{"status":400,
"internal":{
"procedure":"push!(LOAD_PATH, string(ENV[\"HOME\"],
\"\/model\/\")); import Epicenter; using Juliet; using EpicenterSystem; EpicenterSystem.setup_idle_timeout
(1800); require(\"MyModel.jl\"); using MyModel","sessionId":"c5b8189b-4f4d-4377-87a9-ca8d154863c0","trace":""}
},
"message":"Bad Request."
}
我已经尝试了所有我能想到的“模型变量”组合,包括“input1”、“parameters”和“parameters.input1”;总是返回 400 错误。
【问题讨论】:
-
您能否提供更多上下文和/或代码,以便人们可以看到您在做什么并提供帮助?
标签: julia