Free AnyLogic basic lessions - Learning AnyLogic by examples is made by Khoi Tran.
In this example you can learn, how to create an embedded active object.
1. Become an AnyLogic Expert Step by Step How to create an embedded active object
2. About me khoi.tran@simbean.com 2 My name is Khoi Tran and I’m living in beautiful Stuttgart, Germany. As a 12-years expert in the software industry and 6-years expert in simulation with AnyLogic, I would like to share my experiences with you on a simple and fast path.
3.
4. Create a new model khoi.tran@simbean.com 4 Write the name of the model e.g. „DemoEmbeddedObject“ Choose menu item „Model“ Right mouse click on the Project view Create a new model
5.
6. Choose this menu itemWrite „SpeedControl“ instead of „MyClass“ Create an active object called “EmbeddedObject” in the model project
7. Insert object from palette to an active object khoi.tran@simbean.com 6 Drag & drop all the objects onto the graghical editor
8.
9. There is no property changeParameter “speed” in “general” palette Set default value to 10 “speed” is from data type “double” You need to click on each object to see its properties.
10.
11.
12. Set properties for image khoi.tran@simbean.com 11 Drag & drop the image here Set this image as an icon choose the icon image here
15. Select “Create a group”Rename the picture group to “groupCar”
16. Embed an active object to onther active object khoi.tran@simbean.com 13 Drag & drop the active object ”EmbeddedObject” onto the graphical editor Animation part Logic part Each time you drag & drop an active object to another, you can get the animation part and the logic part of the embedded active object
17. Create and connect embedded active objects khoi.tran@simbean.com After drag & drop three “EmbeddedObjects”, you can make connections and arrange the animations like this 14
18. Change the value for the parameter khoi.tran@simbean.com 15 Set value for parameter in each embedded active object You can remember we created one parameter in the embedded active object. Now you can set the value for each embedded active object.
19. Set properties for „source“ khoi.tran@simbean.com 16 Write “groupCar” for the entity animation shape Set the unique shape for each entity
20. Run the model khoi.tran@simbean.com Click on the run button and choose the simulation 17 You can run the model and see the result Try to change or set properties to see some small effects e.g. Where the property is put on “false”, you can turn it on with “true” Set and unset the checkboxes Change the capacity of the queue Change the animation type of the queue to “bag” Change sizes of the rectangle and the polyline Change the properties of conveyor, like “animation direction”, “accumlating”, “speed” etc. You need to restart the model to see the effects
21. Thank You khoi.tran@simbean.com 18 IF YOU HAVE ANY QUESTION, IDEA, FEEDBACK or FIND ANY MISTAKE, PLEASE SEND ME an EMAIL khoi.tran@simbean.com BECAUSE I WOULD LIKE to IMPROVE this SLIDE CONTINUOUSLY. I APPRECIATE a lot YOUR TIME.