Building Lesson 1 Model
Open the application by double clicking on the FlexSim icon on your desktop. Once the software loads, you should see the FlexSim menu and toolbars, Library, and Orthographic Model View windows.
If at any time you encounter difficulties while building this model, a fully functional tutorial model can be found at http://www.flexsim.com/tutorials
Starting a New Model
- Open FlexSim by double-clicking on the FlexSim icon on your desktop. The Startup Wizard appears by default. Select the "Build a New Model" option.
FlexSim allows the user to select appropriate units for a model. By default, the Model Units dialog will appear for each new model. You can select units for time, length, and fluids. The units you choose will be assumed throughout the model. For this model, use the following:
- Time Units: Seconds.
- Length Units: Meters.
- Fluid Units: Liters.
Step 1: Create the Objects
- Create a Source in the model and name it Source (To see how this is done, click here).
- Create a queue, 3 Processors, 3 Conveyors, and 1 Sink in the model. Place and name them as shown below. To name an object: double-click on it, change its name at the top of the Properties window, and press Apply or OK. Click Here to see how this is done.
Step 2: Connect the ports
Enter the connection mode by either clicking the button or by pressing and holding the A key on the keyboard. Once in the connection mode, there are two ways to make a connection between objects. You can either click on one object and then click on another object, or you can click and drag from one object to the next. Either way, keep in mind that the flow direction of a connection is dependent on the order in which you make the connection. Flow goes from the first object to the second object in the connection. Incidentally, connections can be broken by clicking the button or by pressing and holding the Q key on the keyboard while clicking or dragging from one object to another in the same manner as when you connected them.
- Connect Source to queue.
- Connect queue to Processor1, Processor2, and Processor3.
- Connect Processor1, Processor2 and Processor3 each to its adjacent conveyor.
- Connect each of the three conveyors to Sink.
Step 3: Assign the arrival rate
In this model we need to change the Inter-Arrival time and the itemtype to generate 3 types of items.
- Double-click on the Source to open its Properties window
- On the Source tab, select Statistical Distribution from the Inter-Arrivaltime list. A statistical distribution popup will appear.
- Set Distribution to exponential.
- Set Location to 0.
- Set Scale to 20.
- Set Stream to 0.
The next thing we need to do is assign an itemtype number to the flowitems as they enter the system. This will be uniformly distributed between 1 and 3. The best way to do this would be to change the itemtype on the OnCreation trigger of the Source, so don't close the Properties window yet.
Step 4: Set Itemtype and Color
- Click the Triggers tab, and add a function (click the button) to the OnCreation trigger and select the Set Item Type and Color option. The code template popup will appear.
The duniform distribution is similar to a uniform distribution except that instead of returning any real number between the given parameters, only discrete integer values will be returned. The default values will be used in this example.
- Click OK to apply the changes and close the Properties window.
The next step will be to detail the queue. Since the queue is a place to hold flowitems until they can be processed at the processor, there are 2 things we need to do. First, we need to set the capacity of the queue to hold 25 flowitems. Second, set the flow options to send itemtype 1to Processor1, itemtype 2 to Processor2, and itemtype 3 to Processor3.
Step 5: Setting the queue Capacity
You may set the queue's Maximum Content by clicking on the queue in the 3D view to display its properties in the Quick Properties window.
Alternatively, you can open the object's properties window:
- Double-click on the queue to open it's Properties window.
- Change the Maximum Content to 25.
- Don't close the Properties window yet.
Step 6: Define the Flow for the queue
You may define the queue's flow by clicking on the queue in the 3D view to display its properties in the Quick Properties window.
Alternatively, you can open the object's properties window:
- Click the Flow tab in the Properties Window to set the flow options for the queue.
- On the Send To Port list, select By Expression
Since we have assigned an itemtype number equal to 1, 2, or 3, we can now use the itemtype to specify the port number through which flowitems will pass. Notice that the default output port is: getitemtype(item). Leave this as it is. Processor 1 should be connected to port 1, processor 2 should be connected to port 2 and so on. Click outside of the box to apply the trigger.
Click the OK button to apply and close the queue's properties window.
The next step is to set the processor times.
Step 7: Define the Process Time
You may define the Processor's Process Time by clicking on the queue in the 3D view to display its properties in the Quick Properties window.
Alternatively, you can open the object's properties window:
- Double-click Processor1 to open its Properties window.
- On the Processor tab, in the Process Time section, select Statistical Distribution from the Time list. The statistical distribution popup will appear.
- Set Distribution to exponential.
- Set Location to 0
- Set Scale to 30.
- Set Stream to 0.
- Repeat this for the other 2 processors.
The default speed for the conveyors is already set to 1 length unit per time unit so there is no need to modify the conveyors at this time.
Now we are ready to run the model.
Step 8: Reset and Run the model
- Always click the button to reset system and model parameters to their initial state before running a model.
- Click the button to start the simulation.
You should see flowitems entering the queue and then moving to the processors. From the processors, flowitems should move to the conveyors and then to the sink. You can change how fast the model runs by moving the Run Speed slide bar on the Simulation Run Panel.
Step 9: Viewing simple statistics
The above image shows how to view simple statistics for each object. If nothing is showing or only the names are showing, you can change the View Settings to show the statistics. To change the View Settings, click somewhere in the background of the view and in the Quick Properties window to the right, change the Show Names combo box to Show Names and stats.
You can view more statistics of an object by clicking on the object and viewing the statistics tab in the Quick Properties.
Step 10: Save Model
Save your model by clicking the Save button on the main toolbar. The "Save FlexSim Model file" window will appear allowing you to navigate to the folder where you want to save your model. Change the "File name" to an appropriate name (lesson1.fsm) and select save. Remember that the file name extension must be .fsm.
You have now completed Lesson 1. Spend some time reviewing the steps and viewing the model as it runs. Congratulations!
To continue the tutorial, go to Lesson 2.