微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用单选按钮可按用户偏好指示资源退出路线

如何解决使用单选按钮可按用户偏好指示资源退出路线

使用单选按钮作为界面,供用户用来引导资源退出路线。

enter image description here

单选按钮选项将链接到其中一个或两个。

enter image description here

我已经使用radio.getValue();函数来输入和输入1。

enter image description here

在运行模型之前,我想手动选择资源输入路线(输入,enter1或enter和enter1)。我引入变量或参数的方法失败了。

不确定如何将出口链接到单选按钮吗?

解决方法

您可以在exit块的“退出时”代码中使用此代码:

if (radio.getValue() == 0) {
    enter.take(agent);
}
else if (radio.getValue() == 1) {
    enter1.take(agent);
}
else if (radio.getValue() == 2) {
    // decide yourself which enter block,can use randomTrue(.5)....
}
else {
    error("Unexpected radio choice");
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。