AnyLogic 将字符串转换为节点
AnyLogic convert String to Node
有人可以帮我从 String
转换为 Node
吗?
问题是,当我从 database
加载数据时,我无法将 varchar
数据类型转换为 Node
或 INode
。
感谢提前!
如果您想将代理发送到名称与数据库中的值相同的矩形节点...
String theName=selectFrom(db_table)
.firstResult(db_table.tarhely);//let's assume this gets you the name of the node
Node rect=findFirst(network.nodes(), n->n.getName().equals(theName)); //this will get you the node
network.nodes() 将为您提供网络中存在的所有节点...请注意 select 正确的节点网络,如果您有很多...那么您将获得第一个名称与 findFirst..
匹配的节点
有人可以帮我从 String
转换为 Node
吗?
问题是,当我从 database
加载数据时,我无法将 varchar
数据类型转换为 Node
或 INode
。
感谢提前!
如果您想将代理发送到名称与数据库中的值相同的矩形节点...
String theName=selectFrom(db_table)
.firstResult(db_table.tarhely);//let's assume this gets you the name of the node
Node rect=findFirst(network.nodes(), n->n.getName().equals(theName)); //this will get you the node
network.nodes() 将为您提供网络中存在的所有节点...请注意 select 正确的节点网络,如果您有很多...那么您将获得第一个名称与 findFirst..
匹配的节点