AnyLogic - Creating new Agent remove _value - anylogic

I want to create a new Agent out of a database. The agent should have several parameters like material type, length, ect.
My Problem is, that i get a lot of errors, trying to define my agent with java code. I think the problem results out of line 868 and 869 in my main code. AnyLogic has a problem defining the VALUE of an agent trough a code block.
So how can I "delete" or remove the
Agent _value; _value = ?
Here's a picture: enter image description here
I have seen a program like mine in the past WITHOUT these two lines. So I know it's possible, but I don't know how. Can anyone please help me? Thanks in advance.

Do not instantiate agents using MyAgent newAgent = new MyAgent(...)
Always instantiate agents into (empty) populations using add_MyAgentPopulation(...)

Related

How can I pass simulationClass as a parmeter in gatling

please I have several simulation Classes and I want to give the users possibility to enter the name of simulation he / she wants to run from a jenkins pipline
For that I want to parametrize the simulation name so insted that user write the command : mvn gatling -Dgatling.simulationClass=package.theNameofSimulation ( here the name is static) , I want him directy enter the name of simulation he choose, enter image description here
because I guess that the user doesn't know the code and commands
so we have the possibility to passing in parameter the numberOfVirtuelUsers I want to do the same thing for simulation
Thanks you
Maybe if you create an environment variable, you could paramatize the simulation classes. I'm very note sure because i'm newbie in gatling but i do that on other things like URL, users, time etc... and that's work so why not the simulation class.
String nameSimulation = String.format("Dgatling.simulationClass=package.%s", System.getenv("NAME"));

I’m getting below error while I try to execute a workflow on Powercenter

Transformation Parse Warning [<<P M Parse Warning>> <<Invalid constant sun-expression>> <<Expression Error>> [TO_DATE]:invalid string for converting to Date
… t:TO_DATE(s:s:”,s:s:’YYYYMMDD’)
……….
AND SATIS_TARIHI = >>>> TO_DATE($$RUN_DATE,’YYYYMMDD’)<<<<];
How can I solve this?
This is the first time I encounter this error. Normally, this is a daily routine for our job. The parameter is successfully added to the mapping and all the other things seem okay. I’d appreciate your help.
I tried to start the workflow and got this error.
You need to define a $$RUN_DATE in mapping. Currently its not defined in mapping or its null in parameter file.
You need to set a default value in mapping like 20221221 for today.
Or else you can set it up in a parameter file like this
[folder.workflow_name]
[folder.session_name]
$$RUN_DATE=20221221
Considering this is your daily routine and up till now it has been working fine, I assume this is not a new development and no recent changes have been made. Apparantly PowerCenter got an invalid value for the parameter.
Check you parameter file and how it gets generated.
Was the process of generating paramfile executed without issues?
Was there enough storage space?
Can you verify the paramfile contents?
Can you regenerate it?
Can you modify it and provide some value manually?
Feel free to get back with some updates for more help if your problem won't get resolved by checking the items on the list above.

How to assign specific technician to solve specific problem in AnyLogic?

I have a agent "customer" with the parameter "BatteryProblem" randomTrue (0.5), and I have a agent "Technician" with population of 3. How can I assign one technique to solve only "BatteryProblem" and the other two techniques to solve the remaining problems that are not battery related?
My model details are given below:
Create a variable inside technician agent called problemsSolved of type String. In the main agent, on startup, manually assign what each technician does. Like technicians(0).problemsSolved = "battery".
You can use the "custom resource choice" setting.
Then the incoming agent can choose to only seize resources where unit.problemsSolved.equals("battery"). Like this;

Store pedestrian agents position in a txt

I'm new on AnyLogic, I'm a universitary student, I'm working in my title project and I still can't get to save the coordinates of my agents in time. I've been working with this tool for near 3 months and just started to seek for help.
I tried with traceln(getX and getY), propperly written, but it only shows me the entrance position, how could I create a function to store this information onto a txt file? Or how could I create a new agent type to apply the steps above described
Please your help
Here is a simple example to show you how to do this.
I have a custom pedestrian agent that gets created in the ped source block and a population, which starts of empty where all the pedestrians that gets created get added to.
This is just so that I can have the event to record the location inside the agent and the file object to write to is on main. So we need to access main from inside the agent.
In the file object, I just set it to write and selected a blank .txt file that I created.
You can read more about using the text file from the help - https://anylogic.help/anylogic/connectivity/text-file.html
Inside the pedestrian agent, I have an event that simply saves the location to the file in a new line.
I make use of the "\t" so that the txt file is tab-separated. You can use whatever separator you prefer.
You must remember to call the close command on the text file when you have finished writing to it. I simply called it on the destroy code of main. So it only "writes" the data to the text file when you close the model.
Here is the output from this very simple example
Calling getX() and getY() on agents does definitely give their current coordinates (assuming they are in a continuous space and not GIS/discrete space) so it's likely you're calling this on the wrong agents (e.g., calling it for your instance of Main instead of for some agents living in a population inside it).
Or you're not actually calling it at different simulation times (via, say, a cyclic event), so you're only getting the initial values.

Can I enable / Disable an Azure Service Bus Topic using Powershell

I have spent a couple of hours search for a solution to disable my Azure Service Bus Topics using Powershell.
The background for this is we want to force a manual failover to our other region.
Obviously I could click in the Portal:
but I want to have a script to do this.
Here is my current attempt:
Any help would be great.
Assuming you're sure your $topic contains the full description, modify the status parameter in the array and then splat it back using the UpdateTopic method. I'm afraid I can't test this at present.
$topic.Status = "Disabled"
$topicdesc = $NamespaceManager.UpdateTopic($topic)
I don't think you'll need to set the entity type for the Status, nor do you require semi-colons after each line of code in your loop.
References
PowerShell Service Bus creation sample script (which this appears to be based off): https://blogs.msdn.microsoft.com/paolos/2014/12/02/how-to-create-service-bus-queues-topics-and-subscriptions-using-a-powershell-script/
UpdateTopic method: https://msdn.microsoft.com/en-us/library/azure/microsoft.servicebus.namespacemanager.updatetopic.aspx
Additional note: please don't screenshot the code - paste it in. I'd rather copy-and-paste than type things out.