![]() ![]()
Tired of panning? Fed up with zooming out and back in? Want to provide a professional interface for model users? The view area object in AnyLogic is a useful little helper for that. alp file such that your agents don't have a direct handle to to it. It's also helpful for models where the 'Main' agent is in a different. The “origin_VA.navigateTo() ” method will work the same whether the agent is in a population or not. Bonus hintīlog reader Justin Rawlings previously pointed out that there is another useful feature: If you have the 'create view area in origin' option ticked on your agent class properties, Anylogic creates a view area called “origin_VA” for you. something like “get_Main().myAgentPopulation.get(12).viewArea_AgentDetails.navigateTo()”, which will take you to the 13th agent from the myAgentPopulation population on Main (Java is zero-based). If you want to jump to another agent in your model, you need to use the object-oriented framework of AnyLogic and Java, i.e. In this example, clicking the button will force the model to jump to the animation view area. During building your models, have you ever noted the shy little button shown below? There are different ways to actually use your view areas.ĪnyLogic provides a build-in method to use your view areas. ![]() In order to appreciate the different options, I recommend you play around with them. Thereby, you can explicitly specify which area should be visible. Note that you can also define a fitting area if you select “Zoom to fit” and its related options. The other shows “Statistic XYZ” and is just zooming into that specific statistic. One shows “All stats” and is zoomed out a lot. So you could have 2 view areas close to each other. The “Scaling” property allows you to zoom in and out of the model while jumping to your view area by using the “Specified zoom” option. If you want to ensure they see a core statistic, you’d drag your view area right into the middle of it and align it to “Center”. Here, you can fine-tune what the client should see, independent of her screen resolution or monitor. ![]() The default setting “Top left” means that you will see what is below and right of the view area object. The “Align to” field defines which part around the view area will be displayed. Instead, you can provide a useful hint for your clients of where this view area will take them. #ANYLOGIC JAVA ADD AGENTS CODE#Note that it is not a Java code field so you cannot write code here. The “Title” property is a text field accepting any string. Wherever you drag it, this is what the client will be taken to when using the view area. ![]() Drag it into your model somewhere and you are ready to go. You can find our little friend in the “Presentation” library, conveniently named the “View Area” object. This can be within the same model object (from one corner of “Main” to another) but also to different agents or even the experiment setup page. The view area object helps you jump to set areas of your model directly. But what about your client? Usually, he wants to jump to important areas of your model with just one click (check my post on a model navigation ribbon bar for more help on this). You might be OK with lots of panning during development. This week, we will look at yet another one: the view area object (check my posts on the magic lightbulb for yet another). #ANYLOGIC JAVA ADD AGENTS FULL#Are you in a panning crisis, too? The more I write these blogs, the more I realize that AnyLogic is full of little magic helpers that people are not aware off or forgot. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |