zorsite 发表于 2016-4-6 10:32:13

标签入门-基于Flexsim7.7.4

本帖最后由 zorsite 于 2016-4-6 10:48 编辑

•标签是建模者自定义的一种变量,用于存储数据。
•任意实体或临时实体都可以被“贴上”标签。
•可以根据需要设置无数个标签。
•不同用途的标签应设置不同名称,便于区别、理解和记忆。
•标签数据可以是文本、数字,甚至可以是表格。

•建模者可以根据需要,随时对标签进行“增删改查”等操作。
•增:setlabel,assertlabel
•删:dellabel
•改:setlabel
•查:getlabel
•引用:label,assertlabel
Assertlabel:如果标签不存在,新增一个特定类型的标签,并返回该标签的引用。此命令不能给新增的标签赋值。
Setlabel:如果标签不存在,新增一个标签并赋值,如果标签已存在则直接赋值。

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

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 existDescriptionThis command returns a reference to alabel with the given name. If the label does not exist, one is created with thedefined data type.Exampletreenode newlabel =assertlabel(node("/Processor1",model()),"MyLabel",DATATYPE_NUMBER);

dellabel
(obj object,str/num label)Delete the label from objectDescriptionDeletes 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.Exampledellabel(current,"MyLabel")

getlabel
(obj node, str/numlabel)Gets the value of an object's label.DescriptionReturns 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).Examplegetlabel(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 labelDescriptionReturns a reference to the specified labelnode on the given object.
The label parameter can be a label name or its rank.Exampleinc( label(item, "mylabel"), 5);

setlabel
(obj node, str/numlabel, num/str/node value)Sets the value of an object's label.DescriptionSets 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.Examplesetlabel(so(),"ProcessTime", 5)

zorsite 发表于 2016-4-6 13:42:21

应用案例2
•模型描述:
•有四台处理器用于分别加工四种不同类型的产品,加工完毕的产品经过同一检验台进行检验,合格产品发往下游,不合格产品返回相应的处理器进行二次加工,返回产品有优先加工权。
•参数设置:
•产品到达时间服从指数分布,均值30

•四种产品按照20:30:40:10的比例产生
•产品首次加工时间为100,返工产品加工时间为120

•不合格产品的比例为10%

•要求:
•不合格产品显示为白色
•实时显示处理器加工时间

light_zm 发表于 2020-12-5 12:30:22

非常感谢

李锋 发表于 2022-3-2 22:00:05

很好的模型,启发了思路,感谢分享,辛苦制作

Hedy 发表于 2023-8-29 14:23:14

产品首次加工时间为100,返工产品加工时间为120,这个条件设置,采用最新2022版本怎么设置呀
页: [1]
查看完整版本: 标签入门-基于Flexsim7.7.4