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

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;

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"));

How to inject (in a source) multiple agents but with different parameter settings

I am currently building a model on a manufacture process line and I am trying to inject multiple agents in the model in a specific moment. The agents are components and there are different types of it (blades and tower). What I want to implement is for example injecting 6 new agents in the source and then specify that 2 of them are component.type='blade' and 4 of them are
component.type='tower'. Is this possible?
Yes, it is possible through Enter block. You can't join it to a Source block (because it acts like a Source block), but for the next block in the sequence. Create programmatically new agents, then send them to the Enter block.
Component component = new Component (param1, param2,...);
component.type = 'blade'
enterComponent.take(component);

Export specific agent trajectory in Anylogic?

I'm new to AnyLogic. I'm trying to export the pedestrian trajectory from my model. I used an event updated every simulation time unit with code: traceln("When time is "+ (int) time()+ " ," + getId()+"is at ("+getX()+","+getY()+")"), and get several agents' id and location information with specific time.
Anylogic console image
But when I use textFile.println() with same command to export them, the information I get in outside text file is only one agent.
text file image
Is there anyway I can export all of them?
Simply call the code from within the pedestrian agent (if you defined a custom agent) or use the ped keyword within pedestrian-library blocks code sections (ped.getX()/Y).

AnyLogic - Creating new Agent remove _value

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(...)

Rundeck implicit variable

Run dick gives us the ability to define options to be entered by the its GUI, is there any capability to have job variable based on the input without the end user of the job seeing it?
E.g, if the the user choose the product and the environment and the product behind LB, I want to use a script internally to define new job variable and assign it the port number that could be used later on within the job steps.
Yes, there is.
You can add a new option whith Allowed Values set to Remote URL, then put the URL to your script which will return the actual value based on other options.
For exmaple
http://localhost/cgi-bin/getPort.py?environment=${option.environment.value}&product=${option.product.value}
Rundeck Manual option-model-provider