How can I connect two agents? - anylogic

I am very new to Anylogic and am trying to send/receive information between agents, but not sure how to accomplish that. Attached please find an image which shows connections between agents. It also shows two-way connections between agents and dependent variables 1.
What parameters/settings does one need to change to develop such a diagram?
So far I have tried embedding a dynamic variable inside the agent and then drawing a connector between the agent and a dependent variable - but doing so replaces the agent icon with a dynamic variable icon.

you cannot connect agents graphically with connectors (except in special cases).
Normally, you use the "Agent Link" objects to establish agent connections and send messages. In short, you do the following:
drag it into agent type 1
Set it up to connect to agent type 2
when it asks to create a corresponding Agent Link object in type 2, agree
Now, you have a way to connect agents using the agent link object.
Do check the AnyLogic help and tutorials on that, there is a lot of info on how to use them.

Related

Monitor Multiple variables in one subscription Node OPC-UA

I am Using NodeOPCUA To detect Variable change,So i am using this code as ref
https://github.com/node-opcua/node-opcua/blob/master/documentation/creating_a_client_callback.md
Every thing is working fine, only i need to is it possible to monitor multiple Variable value change in one subscription ,if possible please share the ideas, Thanks

How to get a particular service block process nested agents in Anylogic

I am working on a ticketing model framework, where we receive requests for single or bulk user account creation in an SAP system. The request is an agent which have multiple agents - user(s) inside it.
So, as you can see in the image we have
Source - Request is coming from here.
Delay(createRequestNo) - A request no. is assigned to the Request at this block.
Service(userCreation) - User(s) are created at this block.
Sink - Request (agent) goes out from this block.
resourcePool - A team of 15 who works on creating user accounts. It is linked to service block.
Imagine a bulk request comes in to create 5 users.
How do the resources at the service block process the all 5 user agents which are inside a Request agent here?
You say your Request agent that flows through the process flow has a number of Agents in it, but these don't need to be agents, they can be pure Java classes or requests can also simply carry a number of users to create.
It all depends on the granularity you require
To answer your question you can access the inside of the agents that travels through the process flow and use that to determine the delay or the number of resources to be seized as follow:
Just be sure that the Agent type in the advanced setting is set to the Agent type that you expect in this block. If you set the Source to create a specific agent type it will automatically update all the serially connected blocks for you.
Please note if the user creation process will vary for each user to be created you need a separate delay for each user... and thus it would be better to split into multiple agents for each user creation, and then have them seize, delay and release each resource separately.
With your current logic, they will all be seized and released at the same time.

Error: root.rackStore.detach: The agent is not in a network

There's a really weird issue happening in a model. I even noticed two unanswered questions about it on Stackoverflow. I tried to simplify the model as much as possible to understand the source of the problem with no luck.
The model is as simple as follows:
Source --> Rack Store --> Sink
Resource Pool assigned to Rack Store
In addition to a pallet rack and a home node for the resource.
The error I get after the agent is picked and stored in the rack is:
root.rackStore.detach: The agent is not in a network
That's how simple the model is:
I appreciate any support. Thank you.
After experimenting, I found the answer. My scenario was a bit more complex than the attached image. It had a combine element before the rack pick and Agent Location (combined) was specified as a node within the network. However, that was not enough apparently for AnyLogic to understand that the combined agent is inside the network, so on exit, I added agent.moveTo(node) which is the same node specified as the agent location and it worked.
The whole rack system in Process modelling Library needs to be properly connected by paths, It can't be in free space. I was also facing a similar issue, connecting everything meticulously by paths is the only thing that worked for me.
Its better to use transporters in such cases.

SCOM Rule for Fake Alerts

I am working on a tool to generate fake data for System Center Operations Manager for internal testing purposes. I wrote a script as part of a discovery that is able to create an instance of any class I want and make SCOM fake-discover it. Currently, I'm using a class for AD Printer. Now the next step is to somehow create alerts on behalf of the Printer. For this, I wrote a rule targeted at the AD Printer, which reads from the logs to detect when it should be fired. The logs are being written to from a PowerShell script. However, I see no results. But when I target the same rule to All Windows Computers, I see the alerts.
From what I understand the rule will run on all agents that have an instance of the target class. Since I fake-discovered the AD Printer on this agent (which also happens to be the Management Server), should the rule not run on this?
Any other suggestions on how I can achieve this are welcome as well.
PS. I probably cannot share any of my code as I am under an NDA, but I can clarify my approach further, if needed.
Yes, the Powershell script should run on the agents which have instances of the AD Printer. I recommend you to check the OperationsManager event log for script errors. The easiest way to generate (fake) alerts is to set up a simple, Event-based text log monitor: one specific word can trigger the unhealthy state (which in turn generates an alert), while another word resets the monitor to the healthy state. You can specify criteria for both events. Look at this blog post for further details.

Spacewalk (satellite) activation refresh child channels on client

We have a (spacewalk) rhn satellite server running and several hundred machines registered with it with a few activation keys. Each of these keys have one or more child channels. We need to know how to 'refresh' the registration so that the clients can have any new child channels that we add to be available to them. We would like to be able to write a script that will check the 'currentness' of its registration automatically on a regular basis, but can't work out how to do it without re-registering the machine which would leave too many defunct profiles on the server side. Any suggestions or help would be appreciated.
The activiation key is only used when the system is registered. If you want to change the child channels for a system or systems, you can manage them via the SSM in the UI to do this, or via the API.
The only way to use an activation key to manage channels after registration is to re-register the system with the same activation key.