Defining products on a source
-
- Posts: 9
- Joined: Tuesday 10 April, 2012 - 08:25
Defining products on a source
is it possible to create differents products(with differents labelnames and colors) with one source?
thanks
thanks
-
- Posts: 9
- Joined: Tuesday 10 April, 2012 - 08:25
Re: !!! in source atom
1)hi i want to create 4 differents TYPES of products from one source with differents labelnames and colors. these product schould enter the system at specific rates. how could i apply it . for example ( product a =25% ,B =50% ,C =10%, d=15%). so at the end we schould have 4 differents colors and labelnames. i know i schould set it on trigger on exit but how
thanks for an Answer!
thanks for an Answer!
Re: !!! in source atom
Hello!
Yes, indeed you could use the OnCreation or OnExit trigger. With the following code, the products will have different colors and label values on the rate that you provided:
Good luck!
Kind regards,
Marvin
Yes, indeed you could use the OnCreation or OnExit trigger. With the following code, the products will have different colors and label values on the rate that you provided:
Code: Select all
Do(
Var([valP], vbValue),
valP := Uniform(0, 1),
Case(
WhichIsTrue(
valP <= 0.25,
valP <= 0.75,
valP <= 0.85,
valP <= 1
),
Do(
Color(i) := ColorRed,
Label([Name], i) := [Type1]
),
Do(
Color(i) := ColorBlue,
Label([Name], i) := [Type2]
),
Do(
Color(i) := ColorYellow,
Label([Name], i) := [Type3]
),
Do(
Color(i) := ColorLime,
Label([Name], i) := [Type4]
)
)
)
Kind regards,
Marvin
-
- Posts: 9
- Joined: Tuesday 10 April, 2012 - 08:25
Re: !!! in source atom
the code u gave me doesnt work. i can´t have differents products from the source. i think 4 differents labelnames schould be created with this code on trigger on exit. i used a studentversion.
Thanks for your Answer
Code: Select all
Do(
Var([valP], vbValue),
valP := Uniform(0, 1),
Case(
WhichIsTrue(
valP <= 0.25,
valP <= 0.75,
valP <= 0.85,
valP <= 1
),
Do(
Color(i) := ColorRed,
Label([Name], i) := [Type1]
),
Do(
Color(i) := ColorBlue,
Label([Name], i) := [Type2]
),
Do(
Color(i) := ColorYellow,
Label([Name], i) := [Type3]
),
Do(
Color(i) := ColorLime,
Label([Name], i) := [Type4]
)
)
)
Thanks for your Answer
Re: !!! in source atom
Hello,
What is your criterion to determine the code does not work? What labels are you using? In what way are you using the labels in the other parts of the simulation model?
I created one label [Name], and assigned four different values to this particular label ([Type1], [Type2], [Type3], [Type4]). In case you want the different products to have different labels, you can assign these label on the particular positions. For example, you could do the following:
This way, all products will have one particular label with the value 1. In case the use of labels is not clear, please post your model with a description of what you are trying to accomplish, and maybe I can have a look with you.
Kind regards,
Marvin
What is your criterion to determine the code does not work? What labels are you using? In what way are you using the labels in the other parts of the simulation model?
I created one label [Name], and assigned four different values to this particular label ([Type1], [Type2], [Type3], [Type4]). In case you want the different products to have different labels, you can assign these label on the particular positions. For example, you could do the following:
Code: Select all
Do(
Var([valP], vbValue),
valP := Uniform(0, 1),
Case(
WhichIsTrue(
valP <= 0.25,
valP <= 0.75,
valP <= 0.85,
valP <= 1
),
Do(
Color(i) := ColorRed,
Label([Type1], i) := 1
),
Do(
Color(i) := ColorBlue,
Label([Type2], i) := 1
),
Do(
Color(i) := ColorYellow,
Label([Type3], i) := 1
),
Do(
Color(i) := ColorLime,
Label([Type4], i) := 1
)
)
)
Kind regards,
Marvin
Re: Defining products on a source
Hey there,
Thanks for your reply, it saved my life
Have a nice one
Thanks for your reply, it saved my life
Have a nice one