Become an AnyLogic Expert Step by Step<br />How to access a root active object<br />
About me<br />khoi.tran@simbean.com<br />2<br />My name is Khoi Tran and I’m living in beautiful Stuttgart, Germany.<br />...
About me<br />khoi.tran@simbean.com<br />3<br />In this example you can learn, <br /><ul><li>how to access the root object...
Create an active object<br />khoi.tran@simbean.com<br />5<br /><ul><li> Right mouse click on the project
 Choose this menu item</li></ul>Write „SpeedControl“ instead of „MyClass“<br />Create an active object called “SpeedContro...
Insert a control object to an active object<br />khoi.tran@simbean.com<br />6<br />Choose Control tab on the palette on th...
Set properties for control object „slider“<br />khoi.tran@simbean.com<br />7<br />Enable the “icon” checkbox<br />Set Maxi...
Create Object from Enterprise Library and its connections<br />khoi.tran@simbean.com<br />8<br />Drag & drop elements from...
 Then move mouse to the queue
 Click on the queue</li></li></ul><li>Draw Polyline<br />khoi.tran@simbean.com<br />9<br />Drag & drop polyline<br />Draw ...
Set properties for polyline<br />khoi.tran@simbean.com<br />10<br /><ul><li>Choose the middle polyline
 Choose Properties, then “Dynamic” Tab
 Set Visible on “false”
Choose the middle polyline
 Choose Properties, then “Dynamic” Tab
 Set Visible on “false”
Upcoming SlideShare
Loading in …5
×

AnyLogic - Free AnyLogic basic lessions - Learning AnyLogic by examples - Demo accessRootObject

5,244 views

Published on

Free AnyLogic basic lessions - Learning AnyLogic by examples is made by Khoi Tran.

In this example you can learn, how to access the root object from another active object.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
5,244
On SlideShare
0
From Embeds
0
Number of Embeds
13
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

AnyLogic - Free AnyLogic basic lessions - Learning AnyLogic by examples - Demo accessRootObject

  1. 1. Become an AnyLogic Expert Step by Step<br />How to access a root active object<br />
  2. 2. About me<br />khoi.tran@simbean.com<br />2<br />My name is Khoi Tran and I’m living in beautiful Stuttgart, Germany.<br />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.<br />
  3. 3. About me<br />khoi.tran@simbean.com<br />3<br />In this example you can learn, <br /><ul><li>how to access the root object from another active object.</li></li></ul><li>Create a new model<br />khoi.tran@simbean.com<br />4<br />Write the name of the model e.g. „DemoRootAccessControl“<br />Choose menu item „Model“<br />Right mouse click on the Project area, e.g. At the the point of this pointer<br />Create a new model<br />
  4. 4. Create an active object<br />khoi.tran@simbean.com<br />5<br /><ul><li> Right mouse click on the project
  5. 5. Choose this menu item</li></ul>Write „SpeedControl“ instead of „MyClass“<br />Create an active object called “SpeedControl” in the model project<br />
  6. 6. Insert a control object to an active object<br />khoi.tran@simbean.com<br />6<br />Choose Control tab on the palette on the right side<br />Drag and drop the Slider on the Graphical editor of the active object<br />Drag & drop the slider onto the graghical editor <br />
  7. 7. Set properties for control object „slider“<br />khoi.tran@simbean.com<br />7<br />Enable the “icon” checkbox<br />Set Maximum value to 300<br />
  8. 8. Create Object from Enterprise Library and its connections<br />khoi.tran@simbean.com<br />8<br />Drag & drop elements from Enterprise Library<br />Drag & drop elements from Enterprise Library<br />Drag & drop elements from Enterprise Library<br />Drag & drop elements from the Enterprise Library<br /><ul><li>Double click on the source
  9. 9. Then move mouse to the queue
  10. 10. Click on the queue</li></li></ul><li>Draw Polyline<br />khoi.tran@simbean.com<br />9<br />Drag & drop polyline<br />Draw three polyline<br />You can make double click on the polyline to add more point <br />Then you can move each point to get the right figure<br />
  11. 11. Set properties for polyline<br />khoi.tran@simbean.com<br />10<br /><ul><li>Choose the middle polyline
  12. 12. Choose Properties, then “Dynamic” Tab
  13. 13. Set Visible on “false”
  14. 14. Choose the middle polyline
  15. 15. Choose Properties, then “Dynamic” Tab
  16. 16. Set Visible on “false”
  17. 17. Choose the middle polyline
  18. 18. Choose Properties, then “Dynamic” Tab
  19. 19. Set Visible on “false”</li></li></ul><li>Create shape and shape group<br />khoi.tran@simbean.com<br />Draw the car picture with many polyline and ovals<br />11<br /><ul><li> Select all shape elements by range select
  20. 20. Right mouse click on all selected element
  21. 21. Select “Create a group”</li></ul>Rename the picture group to “groupCar”<br />
  22. 22. Set properties for „source“<br />khoi.tran@simbean.com<br />12<br />Write “groupCar” for the entity animation shape<br />Set the unique shape for each entity <br />
  23. 23. Create embedded active object<br />khoi.tran@simbean.com<br />Drag & drop the “SpeedControl” active object onto the graphical editor of the “Main” active object<br />13<br />
  24. 24. Code for changing the conveyor behaviour in „Main“ or so called „Root“ active object<br />khoi.tran@simbean.com<br />14<br />Write this two lines of code in “Action” property<br />Click on the “SpeedControl” active object to get back to the graphical editor<br />Put the two lines of code<br />Main main = ((Main)getEngine().getRoot());<br />main.conveyor.set_speed(value);<br />
  25. 25. Run the model<br />khoi.tran@simbean.com<br />Click on the run button and choose the simulation<br />15<br />You can run the model and see the result<br />Try to change or set properties to see some small effect e.g.<br /> Where the property is put on “false”, you can turn it on with “true”.<br />Set and unset the checkboxes.<br />You need to restart the model to see the effects<br />
  26. 26. Thank You<br />khoi.tran@simbean.com<br />16<br />IF YOU HAVE ANY QUESTION, IDEA, FEEDBACK or FIND ANY MISTAKE, PLEASE SEND ME an EMAIL <br />khoi.tran@simbean.com<br />BECAUSE I WOULD LIKE to IMPROVE this SLIDE CONTINUOUSLY.<br />I APPRECIATE a lot YOUR TIME.<br />

×