全球FlexSim系统仿真中文论坛

搜索
查看: 3817|回复: 5
打印 上一主题 下一主题

标签入门-基于Flexsim7.7.4

[复制链接]
跳转到指定楼层
1#
zorsite 发表于 2016-4-6 10:32:13 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 zorsite 于 2016-4-6 10:48 编辑

标签是建模者自定义的一种变量,用于存储数据。

任意实体或临时实体都可以被“贴上”标签。

可以根据需要设置无数个标签。

不同用途的标签应设置不同名称,便于区别、理解和记忆。

标签数据可以是文本、数字,甚至可以是表格。


建模者可以根据需要,随时对标签进行“增删改查”等操作。

增:setlabel,assertlabel
删:dellabel
改:setlabel
查:getlabel
引用:label,assertlabel
Assertlabel:如果标签不存在,新增一个特定类型的标签,并返回该标签的引用。此命令不能给新增的标签赋值。
Setlabel:如果标签不存在,新增一个标签并赋值,如果标签已存在则直接赋值。

案例:
有一条具有5个弹出口的分拣线,当产品到达分拣线时,随机的从一个弹出口中分流出去。
要求:
根据标签值设置临时实体的颜色
按照百分比(5:15:20:25:35)来发送临时实体到不同的端口
模型布局:

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
2#
 楼主| zorsite 发表于 2016-4-6 10:40:04 | 只看该作者
本帖最后由 zorsite 于 2016-4-6 10:41 编辑

常用标签命令汇总:
assertlabel
(obj object, strlabelname, num datatype)
Gets a reference to label labelname, creating the labelif it does not exist
Description
This command returns a reference to alabel with the given name. If the label does not exist, one is created with thedefined data type.
Example
treenode newlabel =assertlabel(node("/Processor1",model()),"MyLabel",DATATYPE_NUMBER);


dellabel
(obj object,str/num label)
Delete the label from object
Description
Deletes the specified label from the nodecalled "labels" on the specified object.
The specified label can either be the labelname as a string or the label's rankas a number.
If the label does not exist in that node, this command does nothing.
Example
dellabel(current,"MyLabel")


getlabel
(obj node, str/numlabel)
Gets the value of an object's label.
Description
Returns a label's value. The labelparameter can either be the name of the label or its rank number.
If the label does not exist, this command returns a null Variant (nullvar),which is different than 0 (NULL).
Example
getlabel(so(), "ProcessTime")

if (getlabel(item, "nonexistent_label") == nullvar)
    pt("item label does not exist");


label
(obj object, str/num label)
Gets the node reference to an object's label
Description
Returns a reference to the specified labelnode on the given object.
The label parameter can be a label name or its rank.
Example
inc( label(item, "mylabel"), 5);


setlabel
(obj node, str/numlabel, num/str/node value)
Sets the value of an object's label.
Description
Sets a label's value. The label parametercan either be the name of the label or its rank number. If the label does notalready exist, it will be added.
Example
setlabel(so(),"ProcessTime", 5)
3#
 楼主| zorsite 发表于 2016-4-6 13:42:21 | 只看该作者
应用案例2

模型描述:

有四台处理器用于分别加工四种不同类型的产品,加工完毕的产品经过同一检验台进行检验,合格产品发往下游,不合格产品返回相应的处理器进行二次加工,返回产品有优先加工权。

参数设置:

产品到达时间服从指数分布,均值30

四种产品按照20:30:40:10的比例产生

产品首次加工时间为100,返工产品加工时间为120


不合格产品的比例为10%


要求:

不合格产品显示为白色

实时显示处理器加工时间

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
5#
李锋 发表于 2022-3-2 22:00:05 | 只看该作者
很好的模型,启发了思路,感谢分享,辛苦制作
6#
Hedy 发表于 2023-8-29 14:23:14 | 只看该作者
产品首次加工时间为100,返工产品加工时间为120,这个条件设置,采用最新2022版本怎么设置呀
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|全球FlexSim系统仿真中文论坛 ( 京ICP备14043114号-2 )

GMT+8, 2024-4-26 10:24 , Processed in 0.068004 second(s), 14 queries .

Powered by Discuz! X3.3© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表