最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How do I make an if statement within the select output block in anylogic? - Stack Overflow

programmeradmin0浏览0评论

How do I make an if statement within the select output block in anylogic? So if p_value is 1 it should go to the "true" output. Using this syntax as I want to make a more complicated if-then-else statement.

Filling this text is here to ensure that I can post this post

How do I make an if statement within the select output block in anylogic? So if p_value is 1 it should go to the "true" output. Using this syntax as I want to make a more complicated if-then-else statement.

Filling this text is here to ensure that I can post this post

Share Improve this question asked Feb 2 at 19:21 YopeYope 872 silver badges7 bronze badges 1
  • While this is a valid question and Felipe'Ss answer is top-notch, can I also refer you to the great AnyLogic help which often solves such questions immediately: anylogic.help/library-reference-guides/process-modeling-library/… But always feel free to ask, just remember that there is also a good help out there :) – Benjamin Commented Feb 3 at 6:17
Add a comment  | 

1 Answer 1

Reset to default 1

Option 1:

agent.p_value==1

Option 2

agent.p_value==1 ? true : false

Option 3 checkTrue() and you create a function called checkTrue that returns a boolean

if(agent.p_value==1) return true; else return false;
发布评论

评论列表(0)

  1. 暂无评论