0:03 in this video we'll do a simple example
0:06 that demonstrates how to use semio
0:09 stations uh and we will use the add-on
0:11 processes to implement uh the station
0:14 logic and so the example we're doing is
0:17 a totally madeup example where we are
0:19 decoupling entity arrivals from their
0:23 availability for for processing so we're
0:25 going to have random arrivals and those
0:27 random arrivals will be stored and then
0:30 periodically moved into position to be
0:33 processed and the key Concepts that
0:35 we'll be using in this video are uh
0:38 talking about suio stations uh continue
0:40 talking about add-on processes which we
0:42 did in the previous video uh in
0:43 particular we'll talk about the search
0:47 step and user defined events and so
0:48 let's take a look at the model that
0:51 we'll be building so let me just click
0:54 go to run and what we have is random
0:57 arrivals uh here and
0:59 periodically uh every time an entity is
1:01 created created here every 1 minute I
1:04 believe all of the entities that are in
1:07 this location are moved to this location
1:10 and then on a SE on a different period
1:12 every two and a half minutes I believe
1:14 every all of the entities that are in
1:18 this uh station are transferred to the
1:22 the processing area we also have a user
1:25 defined event and so I can uh click the
1:28 S1 to S2 button at any time to initiate
1:31 the transfer from station one to station
1:34 two so specifically what's going on is
1:37 we have a station defined here station
1:39 one we have a station defined here
1:43 station two we have a button which is
1:45 tied to a user defined event called
1:48 event one and when entities arrive
1:51 they're transferred to station one then
1:54 we have a source which creates entities
1:56 periodically every 1 minute and when
1:59 entities are created all of the entities
2:01 in station St one are immediately move
2:05 to station two on a second period um
2:08 entities are created here at this source
2:10 and when they are all of the entities
2:13 are moved from station two uh into the
2:16 input buffer for uh server
2:19 one before we look at how we would build
2:21 this model we need to look at a couple
2:24 of key Concepts uh that we'll use in the
2:27 model uh first and foremost what is a
2:30 semio station well a station is is an
2:32 element that models capacity constrained
2:35 location for holding entities and so as
2:39 we know simio models entities that exist
2:41 in physical space and so a station
2:45 provides uh a location where I can store
2:48 entities and I can optionally have uh a
2:51 capacity associated with uh that
2:53 location when we look at a server object
2:56 This Server object from the standard uh
2:58 Library we've already talked at length
3:00 about the input buffer the processing
3:02 area in the output buffer and from an
3:04 implementation standpoint these are
3:05 actually stations so there's an input
3:09 buffer station processing station and an
3:11 output buffer station and when an entity
3:14 arrives to the server object it's
3:17 transferred into the input buffer and
3:18 then eventually transferred into the
3:20 process I'm sorry the input buffer
3:23 station then transferred into the
3:25 processing station and then eventually
3:27 transferred into the output buffer
3:30 station and so in using stations uh
3:31 there are two things we have to keep in
3:34 mind we can use uh we can use a transfer
3:37 step uh to transfer an entity from its
3:40 current location into a station and then
3:42 we use an end transfer step to signify
3:45 the end of the transfer from one station
3:48 to another so we'll see in our add-on
3:51 processes as we build the model we will
3:54 have a sequence of transfer in transfer
3:58 then transfer and in transfer and in the
4:01 um uh standard Library objects much of
4:05 the in transfer are done automatically
4:07 and uh many of the transfers are also
4:10 done automatically within the uh
4:12 processes uh that comprise the standard Library
4:14 Library
4:17 objects okay so let's have a look at uh
4:19 how we would build this model so we'll
4:22 just start out with a uh new model here
4:24 and the first thing we're going to do is
4:28 add our source uh object to create our
4:30 entities and we'll just use use the
4:33 Standard inal Time Properties and have
4:36 them arrive according to the poison
4:39 process and so we also have our default
4:42 entity and the when entities arrive what
4:45 we want to do is transfer them into a
4:47 station and so we need to First Define
4:50 that station so I'm going to go to the
4:54 model and the definitions and we see our
4:57 elements uh section here and I'm just
4:59 going to click on station and and we'll
5:01 just leave the default name of station
5:05 one so we've now uh created a station
5:08 and what we want to do is when entities
5:13 enter the um output node we will create
5:16 an add-on process that simply transfers
5:18 them into the station so I'm going to
5:21 click on the add-on process triggers and
5:24 use the shortcut so I'll just
5:29 doubleclick on the um entered and add
5:33 process and so when a uh entity enters
5:38 the the output buffer I want to transfer
5:41 immediately from the current node is we
5:44 did this when it we have the add-on
5:46 process when it enters the output and
5:47 this time we want to transfer to a
5:51 station and so the transfer uh two type
5:54 is station so we will transfer from the
5:57 current node which is the output to of
6:00 Source One to a station
6:03 and we want it to go to station one now
6:06 we also know that when a entity is
6:08 transferred into a station we have to
6:11 manually end the transfer so I'm going
6:14 to create a new process by clicking on
6:16 the create process button and it creates
6:19 a process named process one and I'm
6:23 simply going to add the end transfer now
6:25 we have a process that ends the transfer
6:27 and we need to tell simeo at what point
6:30 do we execute that process
6:33 and so I'm going to select the process
6:35 so I move away from any one of the steps
6:37 and just click and you see the hatch
6:40 line so I've selected the process and
6:42 I'm going to go over to the triggering
6:45 event name property click on that and
6:49 select station one entered and so now we
6:52 see the little lightning bolt symbol
6:55 here with station one. entered and that
6:58 tells us that this uh that uh this
7:01 process is ex executed when the event
7:03 station one entered occurred so if we
7:07 look at our model we have um entities
7:09 that arrive randomly Source uh Source
7:14 One when they enter the output node the
7:17 process output undor Source onecore
7:20 entered is executed that initiates a
7:23 transfer from that node to station one
7:25 when station one is entered simia will
7:27 automatically fire an event called
7:30 station 1. entered and which point we
7:33 simply end the transfer so if we go back
7:36 to our model now I want to display that
7:39 um the contents of station one so I'm
7:42 going to go to the animation ribbon and
7:46 just select detached q and now I'll draw
7:49 a detached Q
7:52 here and the Q State Property
7:56 defines the CU that the the detached
7:58 queue that I'd like to animate so I'm
8:00 going to go down to station one.
8:04 contents and station one. contents says
8:07 show me the contents of the station one
8:10 uh station and so now when I run my
8:12 model we can see that when entities
8:14 arrive they're immediately uh
8:17 transferred into the station now our
8:19 model doesn't do anything else so if we
8:21 continue to let our model run the
8:23 station will just continue to build
8:25 since we didn't put a capacity since we
8:28 didn't specify a capacity this would
8:30 just run until we exceeded the maximum
8:33 number of entities in the
8:35 system so the next step we're going to
8:38 do is add station two so recall that
8:40 when entities arrive uh in the random
8:42 arrive randomly they're placed in
8:44 station one and then periodically we
8:46 will transfer them to station two so I'm
8:49 going to go to my model at definitions
8:51 and create station two again we'll just
8:53 leave the default name then I'm going to
8:56 go back and I'm just going to copy the
8:59 animated que so I can just use use the
9:03 contrl C to copy it to the clipboard and
9:07 the contrl V to paste it and then I can
9:09 just go over and change the property
9:12 from station 1. contents to station 2.
9:14 contents the next thing I'll do is I
9:16 know that I have to end the transfer and
9:18 so this is something that when I'm doing
9:19 process when I'm doing models like this
9:22 I often forget so I try to do it as soon
9:24 as I create the station I go ahead and
9:27 create the process to um to end the
9:29 transfer so I'm going to do that call it
9:31 process two we'll just leave the default
9:35 name and I want this process to execute
9:37 when Station 2 is entered so it's a
9:40 identical to uh process one and except
9:43 it happens when station two is entered
9:46 so now we have uh our two stations and
9:49 we need the logic for pulling all of the
9:52 entities out of station one and
9:53 transferring them to Station 2 that's
9:56 the thing that we want to happen uh
9:58 periodically so I'm going to do that
10:00 with an add-on process process I'll go
10:04 create add-on process 3 and again we'll
10:07 just use the default name and
10:08 essentially what I need to do in this
10:10 process is pull everything out of
10:12 station one and transfer it to station
10:15 two so before I do that I'm going to add
10:18 an additional symbol to our uh default
10:22 entity so that we can change its color
10:25 uh as it um as it moves from Station to
10:28 Station so go back to our process here
10:31 we have process three and we'll use the search
10:32 search
10:37 step and over in the uh properties uh we
10:40 specify the collection type as a q state
10:42 so I'm telling samio I'd like to search
10:46 the Q State and I want selection one
10:49 contents and so this is saying uh search
10:52 the Q State selection one contents uh
10:54 and we're going to leave the remaining
10:56 basic logic to its defaults and I'm
10:58 going to open the advanced objects and
11:00 there there's a limit and if you click
11:02 it it says the maximum number of items
11:05 defined that defaults to one we want
11:07 everything so we'll change that to
11:11 infinity and so when the token executes
11:15 the search step it pulls everything out
11:18 of station one contents uh because we
11:20 have this set to infinity and all of
11:23 those uh the tokens representing those
11:26 entities come down uh the found uh
11:28 branch of our search so the first thing
11:31 I'm do is change their color so I'm
11:34 going to go to assign and say model entity.
11:37 entity.
11:40 picture and set the value to one it's
11:42 default to zero and then I'm simply
11:47 transfer uh this time from the current
11:51 station which will be station one to station
11:59 two so the process says when uh it when
12:02 this process is executed search uh the Q
12:04 State station 1. contents and with
12:06 everything you found with each entity
12:09 that you found set the picture to one
12:11 and transfer it to station two and
12:13 recall that when an entity enter station
12:16 two SIM automatically fires the station
12:19 2. entered event which then executes
12:21 process 2 which in turn ends the
12:24 transfer and so if we go back to our
12:28 model uh that should achieve uh what we
12:30 want now what we haven't done yet is
12:34 specified when to execute uh process 3
12:35 so I said earlier that this was an
12:37 add-on process as of now all we've
12:40 created is a standalone process so
12:43 before we create the periodic uh
12:45 entities that we'll pull uh pull the
12:48 entities out let's go ahead and specify
12:50 how we do the button so what I want to
12:53 do now is create a user defined event so
12:58 I'll go to model definitions events and
13:00 just click on on the event uh button on
13:02 the ribbon and it creates an event
13:05 called event one then I'll go back to my
13:07 processes and say I want process three
13:11 to execute when event one
13:14 fires so now we have a the lightning
13:17 bolt symbol saying when event one uh
13:20 fires or when event one occurs execute
13:24 this process go back to our facility to
13:27 the uh animation uh ribbon and we have a
13:30 button here so we'll just place the
13:34 button and then in the property we'll
13:38 specify event one so our button say or
13:40 our button logic says when you press the
13:43 button fire event one when event one is
13:46 fired then we should remove everything
13:49 from uh station one transfer it to
13:51 station two and the transfer will be
13:53 ended so we'll let it run for a little
13:55 while as we build up a couple of
13:58 entities in station one when I click the
14:01 button note exactly what we uh thought
14:04 was going to happen happen we remove all
14:06 the entities from station one they
14:09 change color because we've increased the
14:12 uh symbol index and placed in station
14:16 two so now that we can remove entities
14:17 from station one and put place them in
14:20 station two uh basically on command
14:22 using the button we want to generate the
14:25 periodic um pull so we're going to
14:27 create another source and I'll just go
14:31 directly uh into a sync and put a path
14:35 here and so I want this uh to happen on
14:37 a fixed period so I'll go to the
14:40 properties and say let's make the time
14:43 offset one and the uh time interval also
14:46 one and so every one minute starting at
14:50 minute one we're going to um um pull all
14:53 the entities out and so I'm going to do
14:56 that using an add-on process to the uh
15:00 output node and when an entity comes
15:04 enters the output node of source 2 I'm
15:07 simply going to execute process 3 so in
15:10 this case I didn't create a new add-on
15:13 process but instead I applied an
15:16 existing add-on process and and set the
15:18 trigger uh to that uh uh to that
15:21 particular um uh process so now when I
15:24 run every one minute we're going to
15:26 create an entity out of source 2 and so
15:30 the net result is that every 1 minute
15:32 everything that happens to be in in um
15:35 station one will be automatically moved
15:37 to station
15:40 two and finally to finish our model
15:43 we'll put our server so we have a server
15:46 here and we'll place a sync for entities
15:49 once they complete processing and what
15:51 we want to happen is on a second
15:54 interval I want to pull entities out of
15:56 station two and send them directly to
16:00 the server so I will uh put down uh
16:02 another source and another sync just as
16:05 we did before and the cycle that we want
16:08 to use here for this one doesn't really
16:10 matter but let's use two and a half
16:13 minutes so we'll do the same as we did
16:14 with the previous Source we'll set a
16:17 time offset to two and A2 and we'll set
16:21 a interval time to two and A2 so at the
16:25 end of uh at uh Source three what we
16:27 want to do is we want to pull everything
16:29 out of
16:31 the station two and send it to server
16:33 one so at this point we don't have a
16:36 process to do that so we'll go into the
16:38 processes and create a fourth process
16:40 and process 4 is going to look almost
16:43 exactly like uh process 3 so I'm just
16:46 going to highlight uh and use copy and
16:50 paste and paste that um the search and
16:52 instead of searching station one I'm
16:56 going to search station two I'm going to
16:58 assign uh but this time I'm going to to
17:01 assign model entity. picture a value of
17:04 two and before I forget I need to go
17:07 back and do that so I highlight my
17:10 entity add a symbol to get to my third
17:12 symbol and then we'll make it uh a
17:14 different color also so we'll make this
17:18 one uh light blue so we go and now our
17:20 default entity has three symbols the
17:24 green one the red one the blue one and
17:28 in process 4 uh we search all of the uh
17:30 cont contents of station two we
17:34 increment the picture and then we do a
17:36 transfer this time we're transferring
17:40 from a station current station to a node
17:42 and the node we want to transfer is the
17:45 input at server one so instead of going
17:47 Station to Station which we did in
17:51 process three we'll go station to input
17:55 at server one uh for process 4 then we
17:59 go back and the output for Source three
18:02 we will have an add-on process trigger
18:06 saying uh assign to process
18:10 4 and so now uh every uh entities arrive
18:13 randomly every one minute we should take
18:15 all of the entities from station two put
18:16 them in St I'm sorry station one and put
18:18 them in station two every two and a half
18:20 minutes everything should go from
18:24 station two uh to server one and so
18:26 let's um see if that's in fact what
18:29 happens so we grabbed everything for
18:32 station two and now everything goes from
18:34 station two to the
18:36 server and so we've effectively
18:38 implemented uh the model that uh we
18:40 specified in the beginning again this
18:42 model doesn't really do anything there's
18:44 no I haven't come up with a context for
18:46 it uh instead we wanted to just
18:49 demonstrate the use of simio stations
18:51 continue our exploration of add-on
18:53 processes and it turns out that in the
18:55 general modeling context this ability to
18:59 store in detached cues and ex ract or
19:01 pull from those cues sort of on demand
19:03 when when uh conditions in the model
19:06 warranted turns out to be quite powerful