If statement IF-THEN-ELSE嵌套语句NetLogo中的系统动力学命令

If statement IF-THEN-ELSE嵌套语句NetLogo中的系统动力学命令,if-statement,netlogo,systemdynamics,If Statement,Netlogo,Systemdynamics,我在NetLogo的system dynamic中有变量,我正在尝试一个嵌套的if-else,如下所示 Md * (( ifelse n_porg = 0 [ 0 ] [ ifelse ( ( SDIa * Total_norg ) / n_porg ) > 1 [ 1 ] [ ( SDIa * Total_norg ) / n_porg ] ] ) / delay ) 我收到一个错误“预期的报告者”请帮助如果else是命令;不能将命令放到报告器表达式的中间,因为命令不

我在NetLogo的system dynamic中有变量,我正在尝试一个嵌套的if-else,如下所示

Md * (( ifelse n_porg = 0 [ 0 ] [ ifelse ( ( SDIa * Total_norg ) / n_porg ) > 1 
       [ 1 ] [ ( SDIa * Total_norg ) / n_porg ] ] ) / delay ) 

我收到一个错误“
预期的报告者
”请帮助

如果else
是命令;不能将命令放到报告器表达式的中间,因为命令不报告值

使用报告器的
ifelse值
,而不是
ifelse


您可能会发现需要添加括号,例如,
ifelse(n\u porg=0).
ifelse
是一个命令;不能将命令放到报告器表达式的中间,因为命令不报告值

使用报告器的
ifelse值
,而不是
ifelse

您可能会发现需要添加括号,例如,
ifelse(n\u porg=0).