How I can send command to the person agents living in one specific GIS region? Consider there are several GIS regions - gis

Suppose there are 1000 Person agent on 4 (a,b, c,d) GIS region area. On a certain event, I want to communicate with all the agents living inside GIS region "a" . In "a" region we have 200 person agents.If I send message or command to Person state chart, how I can make sure that only those 200 person agents living on that specific GIS region "a" is getting my command? Is there any way to model that?

You can filter messages inside the Agent's statechart transition, in order to only executethe transition when a certain expression is true (in your case: Agent is in the right region).
Of course you could do this filtering in a lot of other places too, for example when sending the message, or when receiving it. However you can always use this code to check if the Agent is located inside of a GISRegion:
main.gisRegion1.contains(this.getLatitude(), this.getLongitude())
This is assuming you executed this inside the Agent (therefore main. and this.) and the region you are looking for is named gisRegion1.

Related

WOSERVICEADDRESS X & Y: Differentiate between sources (SA vs. user-defined)

A question about Maximo 7.6.1.1 work orders:
In the service address tab, there are LONGITUDEX and LATITUDEY columns.
The columns can be populated a couple of different ways:
Automatically from the service address (linked to a GIS feature class).
Manually by a user (by right-clicking on the map and clicking Set record location).
Is there a way to determine what the source was for the LONGITUDEX and LATITUDEY columns?
For example, if the source was a user, then populate a custom field. Else, leave it null.
(Related keyword: Maximo Spatial)
Out of the box, I'm not aware of a way to know that.
If you have configured e-Audit for those attributes and that object, then you can query the audit table for the last record to find out which User made the change. Admittedly, it won't tell you how they made the change, but at least you can differentiate between service accounts and real users.
Other than that, I think you would need an autoscript with attribute.action launch points on those attributes that records the current user and whether the session was interactive (i.e. via the Maximo UI or not) in new xychangeby and xychangedinmx attributes on the woserviceaddress object.
I added a custom field to WOSERVICEADDRESS called XY_SOURCE.
And I created an automation script with an object launch point (Save; Add/Update; Before Save).
sa = mbo.getString("SADDRESSCODE")
x = mbo.getDouble("LONGITUDEX")
if sa and x: --Improved, as per Preacher's suggestion
mbo.setValue("XY_SOURCE", "Service Address")
elif x:
mbo.setValue("XY_SOURCE", "Manual")
else:
mbo.setValue("XY_SOURCE", None)
This seems to do the trick.
I'd be happy to hear if there are any flaws with this logic (or opportunity for improvement to the code).

How can I make a GIS region an agent in anylogic?

Is there any way to make a GIS region an agent? For example, In Arizona we have 15 counties. Can I make the individual county area an individual agent? In the tutorials it mentions how to place one agent in a GIS region but it's not mentioned how to make the whole GIS region an agent which can have it's own statechart.
(If 1st one can be done) Suppose there lives some Person agent on each of those GIS region area (county). Is there any way to move those Person agent based on the state of the county agent?
In simple words, I want to move some Person agents from county "a" to another county "b" based on county's statechart. If I send msg or command to Person statechart, I have to make sure only those person agents living in the county "a" are getting the command to move. Is there any way to model that?
Number 1 can be done, but not directly. Here is how:
create an agent type "myGISRegion"
place a parameter into it and change its type to "GISRegion", name it "p_MyGISRegion"
when instantiating it on Main (or whereever), set the parameter to the GISRegion you like below

Return State ID from Containing County Event

I have a topojson map that has both county and state data in json format. There are no actual names for the states, but the states do each have a unique id. I would like to find a way to return the id of a state if the user clicks on one of its containing counties.
The trouble is I cannot seem to be able to access the state ids in the json when I set up my click event listener. I have sliced and diced the json data every which way, but I keep going in circles. Is it possible to have asymmetric information within the json file? I feel like the state ids are in a black box when working with the containing counties.
Let me know if anything comes to mind. I have a fully functional minimalist example here, where I am trying to return a console log of the state id based on user click.
Note: I would prefer to avoid point in polygon solutions for complexity reasons.
Seems your json file ships with FIPS county code. That means that first two digits of county code are in fact the state code. So Math.floor(county.id / 1000) is what you‘re looking for in the end.

Actor - Actor (Sequence Diagram)

I'm just wondering if it's possible if an actor to actor is allowed in sequence diagram.
and if so can an actor receive true/false statement?
The left one is an actor and the right one is a Class.
Actor-to-actor depiction is used in sequence diagram to shows real-life interaction between the actors, usually at the system level. The goal is to use sequence diagram to identify logic flow and behaviour within the system.
In light of that, it doesn't make sense (and not very helpful) to return a true/false statement to either your aPassenger nor your aCheckInStaff. The message that aCheckInStaff receives should be along the line of "is this ticket valid (does the name match the ID shown, has the ticket expired etc.)?" And that same information will then be passed along to your aPassenger (perhaps together with a boarding pass, if the ticket is valid) to indicate if subsequent flow of actions i.e. does aPassenger need to fix the error, or can she proceed to gates?
There is a good actor-to-actor interaction example here. Take a look at Figure 1 and follow along its use case description here.

authorized.net ambiguity in country names

Hi I am working on a site and integrating authorize.net payment gateway. I am thinking of adding a dropdown for country names, will passing of "United States Of America" as country variable work? Or should I use "US"? Should I use ISO codes for every country? I tried on test developer account but it seems to accept everything I passes to it as correct!
~Ajit
I know authorize.net doesn't require country names. A simple way to see if they even validate them would be to run a transaction through the production gateway, pass a nonsense value and see if the transaction still goes through.
If you do standardize to support authorize.net (or for another reason), I'd suggest country codes versus full names. Codes seem to change less often, and also can be useful as identifiers. For example, I have an application which presents data for roughly 200 countries; I have flag icons (multiple sizes for each country) that use a 2 digit country code in their name. Using codes made this fairly easy to implement and maintain.
According to their AIM Guide:
x_country: Optional
Value: The country of the customer’s billing
Format: Up to 60 characters (no symbols)