使用单选按钮根据用户偏好引导资源退出路由
Use Radio button to direct resource exit route by user preference
使用单选按钮作为用户使用的界面来引导资源退出路由。
单选按钮选项将link编辑到其中一条路线或两条路线。
我已经使用函数 radio.getValue();
进行输入和输入 1。
我想在 运行 模型之前手动选择资源进入路线(进入、进入 1 或进入并进入 1)。我引入变量或参数的方法失败了。
不确定如何link退出单选按钮?
您可以在 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");
}
使用单选按钮作为用户使用的界面来引导资源退出路由。
单选按钮选项将link编辑到其中一条路线或两条路线。
我已经使用函数 radio.getValue();
进行输入和输入 1。
我想在 运行 模型之前手动选择资源进入路线(进入、进入 1 或进入并进入 1)。我引入变量或参数的方法失败了。
不确定如何link退出单选按钮?
您可以在 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");
}