Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Simulation with AnyLogic/Discrete Event Simulation/Ophthalmology Department Model/Step 2. Creating a model animation

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Step 2. Creating a Model Animation Now we will draw the model animation since the logical structure of the model is generated from the animation you draw. To simplify drawing, we will add the model layout first. You can draw the department layout using AnyLogic presentation shapes, or you can import any picture as the layout. The drawing approach is good for prototyping, when you want to experiment with draft layouts. The image approach is excellent for working with an existing layout. File:Step_1._Creating_a_new_model1.gif‎ Add department layout First, open the Presentation stencil of the Palette view. This stencil contains shapes and controls you can add on your presentation. To open some stencil of the Palette view, just click on the corresponding tab of the view.File:Step 2. Creating a model animation 1.png Drag the Image File:Step 2. Creating a model animation 2.gif element from the Presentation palette into the graphical editor (right in the place shown in the figure below).File:Step 2. Creating a model animation 3.png Set up the image properties in the Properties view. Click Add Image button and navigate to layout picture. You can find the layout here: <AnyLogic folder>\plugins\com.xj.anylogic.examples.<build number>\models\Ophthalmology Department\layout.pngFile:Step 2. Creating a model animation 4.png To preserve necessary picture size, select the Original Size option. The image should look like this:File:Step 2. Creating a model animation 5.png Now we will draw the model animation. Drawing an animation, we define the transportation network, where rectangles represent network nodes and polylines — network links. We will draw a rectangle for each department room and connect rectangles with polylines playing the role of moving paths in our model. File:Step_1._Creating_a_new_model1.gif‎ Draw network nodes Draw rectangles representing department rooms. Ophthalmology department has the following functional areas: waiting room, three procedure rooms, storage room for ophthalmoscopes and private office space for medical staff. To draw a rectangle, drag the Rectangle File:Step_3._Creating_a_model_animation_6.gif element from the Presentation page of the Palette view into the graphical editor. Resize rectangles by dragging to fit into the corresponding areas of the layout as shown in the figure below. To simplify drawing, switch binding to grid off by clicking the Enable/Disable Grid toolbar button.File:Step 2. Creating a model animation 6.png Name rectangles as shown in the figure. It is important since we will refer to nodes by their names in future. To make moving in our model more sophisticated, we will also add some additional rectangles to represent intermediate moving destinations. Draw four additional rectangles standing for intermediate network nodes and place them as shown in the figure:File:Step 2. Creating a model animation 7.png Now we will define network segments by drawing polylines. In network-based model polylines represent moving paths. File:Step_1._Creating_a_new_model1.gif‎ Draw network segments Using the Polyline File:Step_3._Creating_a_model_animation_3.gif drawing tool, draw polylines as shown in the following figure:File:Step 2. Creating a model animation 8.png To draw a polyline, drag the Polyline File:Step_3._Creating_a_model_animation_3.gif element from the Presentation page of the Palette view into the graphical editor. Then double-click the drawn polyline to switch to editing points mode. In this mode you can add new points by double-clicking on the polyline and move points by dragging them. Note that all end points of polylines should necessarily lie inside the connected rectangles. The logical structure of the network will be constructed from the presentation shapes added to the group we will specify as the Group of the network shapes. So now we should create a group and add all just drawn shapes to it. File:Step_1._Creating_a_new_model1.gif‎ Add shapes to a group Drag the Group File:Step 2. Creating a model animation 9.gif element from the Presentation palette into the graphical editor. Name the group networkGroup.File:Step 2. Creating a model animation 10.png Add all created shapes to the group. First, select shapes. The best way is to drag the mouse with the left button pressed over the area containing the shapes you want to select.File:Step 2. Creating a model animation 11.png The selected shapes will be highlighted in blue (see the figure below). If some shape has not been selected, you can press Ctrl and while holding it, click this shape with the left mouse button. The shape will be added to the selection.File:Step 2. Creating a model animation 12.png When finished selecting shapes, right-click the selection (you should click exactly on the outline of some selected shape), and then choose Grouping|Add to existing group from the popup menu.File:Step 2. Creating a model animation 13.png Finally, click on the networkGroup. File:Step_1._Creating_a_new_model1.gif‎ Define procedure rooms location Draw a polyline connecting rectangles representing the procedure rooms. We will use it later on.Place polyline points exactly inside the procRoom1, procRoom2 and procRoom3 rectangles.File:Step 2. Creating a model animation 14.png Name it roomsLocation and set custom line color.File:Step 2. Creating a model animation 15.png Make the polyline invisible. Go to the Dynamic page of the polyline's Properties and type false in the Visible field.File:Step 2. Creating a model animation 16.png