How to exclude (ignore) a GIS route programmatically in Anylogic? - anylogic

While working with Anylogic user can open properties of some GIS route (or some other object) and push checkbox "Ignore". The GIS route will be excluded from the model and after running the model user wont see the object because it wont exist.
Is it possible to exclude some GIS routes in interactive mode? For example I drew in Anylogic big GIS network with many GIS routes and after running the model (!) I want to have a possibility to choose routes which should not be included in the network. E.g. it can be implemented in Simulation window.
I was looking for suitable JAVA code but I did not find anything except Visible-property.

you can not programmatically "ingore" something, this is not how Java works.
In your case, the only way is to create the GIS network programmatically as well at the start of the model. Now you have full control because you could decide to only create part of your network, depending on user choice.
Check the AnyLogic API on how to create GIS routes programmatically.
cheers

Related

Autodesk Forge tutorials for Model Check App

Hi everyone
I've started to learn about Autodesk Forge and I'm a beginner in coding.
I've been able to put together the Model 3D Viewer following this tutorial:
https://www.youtube.com/watch?v=8FMwgJcRHz8
My current tusk is:
to build a WebApp on Forge for model elements naming check based on customisable validation schemas similar to this one:
https://www.youtube.com/watch?v=pxM5TojTmLE
With additional functionality of creating a BIM360 issue for every mismatch fond by checker, like this:
https://www.youtube.com/watch?v=j9EgshGh2is
My questions are:
Is there any learning paths or educational platform that I can use to achieve my goals on this?
Can you please share any relevant experience?
Any advices would be highly appreciated
P.S: I know about this one already:
https://learnforge.autodesk.io/#/?id=learn-autodesk-forge
Thanks in advance
Cheers
You can check the object names in two ways:
Option 1: Translate your designs with Forge & check the conversion output
The Forge Model Derivative service can extract all sorts of information (3D geometry, 2D drawings, property metadata, design hierarchies, etc.) from over 60 different design file formats, incl. Revit. The extracted data can then be viewed in Forge Viewer, or explored using various endpoints or through SDKs for specific programming language. In your case you could use the GET :urn/metadata/:guid endpoint to retrieve the design hierarchy which includes object names.
Option 2: Check your designs with custom Revit plugin using Design Automation
If you're familiar with Revit API and plugin development, you could also use the Forge Design Automation service to process Revit models with your custom plugin remotely, by starting a Revit instance on Autodesk servers.

NetLogo LevelSpace Extension for Passing Agents Between Models

I'm using NetLogo's LevelSpace extension to pass agents between two models.
Specifically, I am wanting to make agents leave one model and appear with all of their attributes in another model, and vice versa.
For example, if one model was of a work environment and an agent spent 8 hours at work then, the other model was of the agent's home. That same agent would have all of the same attributes, just be in a different environment. The agent would need to have their attributes updated in each model as well.
I currently have a controller setup to control both model environments and, hopefully, will be able to record and plot data received from both models but I need to be able to pass the agents back and forth first. Does anyone know if this is actually possible and how to achieve it. The LevelSpace dictionary doesn't really have a solution and I can't find a tutorial.

How to intagrate Open Street map editor iD withe geoserver data or planet osm database

I am trying to create my own map with the help of osm data and geoserver,successfully partially completed it with my own SLD..Now I need a web editor for edit that map data .I select "iD" for it. i don't know how to configure it with my planet osm data base
You need to keep in mind, that your current setup is designed to work for rendering only (so an OSM like basemap).
So what you IMHO need:
OSM API services
This is called rails port and is a bit tricky, as it's pretty unusal to clone the whole OSM infrastructure for "usual devs". Please be aware that you also need to think about how you want to deal with your and the official data, as you create some 'fork' of the planet and create a parallel world dataset (update workflow, sharealike license, ...)
Own iD instance
You should also host your own iD instance (or adapt the JOSM settings for each user) so you can contribute via your own API services from step 1.

Set GeoServer to access a Postgresql database, Simple or Snapshot schema, populated by Osmosis

I have a postgresql database which I keep updated using Osmosis. Osmosis can write to two different database schemas, named Simple and Snapshot. There are not that much different from the database Geoserver uses, But I can't make Geoserver use it perfectly.
The main problem seems to be the way tags are stored in those DBs. I can add the nodes layer and display it with that default Points style, but as soon as I use a "ogc:Filter" in my style to filter the nodes by their "place" tag, the WMS is broken and does not respond (says: The requested Style can not be used with this layer. The style specifies an attribute of place and the layer is: TestDB:nodes)
Is there anyway to make GeoServer understand that one of those shemas, or make Osmosis update to the DB GeoServer knows?
This is a case for using TRIGGERs to manage the integration. The two programs use two different schemas. You can CREATE TRIGGERs in the database which ensure that data written to one application is made available to another. Another option is you can set one or both to use VIEWs populated in part by the other application. In PostgreSQL, a VIEW can have triggers attached so these are not really
This is, in any case, a potentially large project so rather than offering sample code, I will offer a general outline of what sorts of things you need to think about.
Are these generally applicable? If so do you want to start an open source integration project?
Are both of these read-only workloads? Does data ever update? In general, if you are going to use views, updates pose the most concerns, so you want to run the views on the side not doing the updates if such is the case.
What is the write model of both sides? Insert/Update? Append only? Static data? What data do you have to "replicate" between the schemas?
Once you have those answers it should be relatively straightforward to get started and ask for help (either as an open source project or here) where you get stuck.

Make a pyramid app ready for standalone and embedded mode

I'm developing a wiki engine. Since this application can be usefull (at least for my company's private use) in its own it should be able to run as a standalone pyramid application, with its own graphical theme.
However a wiki feature could also be useful as part of a bigger project, and I would like to be able to include it into other pyramid applications.
I already found some pyramid features that could help me to achieve this but first I'm not sure whether it's the best way to do it and second some problems remain open.
Here are the potential issues I currently see:
templates: how to switch between the standalone mode and the hosted mode
host variables: event if we can reuse the host template, some variables may be needed to correctly render the templates but are not set by the guest (the wiki engine) application.
authentication: the guest app defines its own login system (based on pyramid_persona). Can the guest application reuse the host authentication system?
My current idea is to use the config.include() system of pyramid. In the wiki engine, in __init__.py I then define an include(config) method in addition the the main() method used for the standalone mode.
In the host application I then define a variable in the .ini file which points to the template file that the guest should use (ie base_template = hostapp:templates/wikibase.mako)
Inside the guest application, the includeme() method reads the base_template variable and overrides some global config.
Then each guest view work like this:
from pyramid.renderers import render
#view_config(route_name="display_wiki_page", renderer=Globals.base_template)
def view_wiki(request):
"""returns a formatted page content"""
page = request.matchdict['page']
content = get_raw_page_content_from_database(page)
page_formatted = render("wikiengine:templates/page_formatting_template.mako",
{'request': request, 'content': content} )
return {'page_formatted': page_formatted}
So from this point the base template can either be the one from the guest or the host application. Both will contain something like (in mako): ${page_formatted | n }
But this does not solve the problem of necessary host variables for the template to be rendered by the guest code. For example the host may need to have a hot_news variable that need to be displayed on each of the host pages, even the pages that host the wiki.
For this I plan use the event system, and add a subscriber for NewRequest or BeforeRender and set the needed variables here inside the request object.
Is this a correct approach ? Are there examples of what I'm trying to do?
Pyramid's configuration mechanisms make it very easy for clients of a module to override configuration. This is one of the most powerful parts of Pyramid compared to other popular web frameworks.
config.include() is a good approach to solving the problem. It allows the caller to override anything defined within the include.
Assets can be overridden using config.override_assets().
Sharing user information requires your module to either provide the user information or define a contract to which someone can conform allowing them to override your model.
Anyway this is obviously a huge topic. Highly modular apps written on top of pyramid include substanced, kotti, ptah, bookie, etc.