0

I am trying to simulate a manufacturing assembly process, where material items are processed following an unique line. In the quality control stations, when a failure is detected, the object is sent to the repair area (by a truckpallet) and, when it is repaired, the same resource takes it and puts it at the start of the line. Until this point, I already programmed it.

The problem is the following: when it is a repaired object, is has to follow the same conveyor but with no stops in the stations. The object must enter a station and leave it, with no delays (as the works related with the stations have already been made).

I thought the best would be to consider the difference (repaired vs. not repaired) in the Agent, but then I can't work with it in the Main agent... I have also tried alternative solutions, for example defining variables in each station 1 and consider that in the stations delays and in the following station:

triangular( 109.1*delay_bec, delaytime_bec*delay_bec, 307.6*delay_bec)

Actions - in finished process:

if(delay_bec==0){
delay_headers=0;
delay_bec=1;}

But nothing worked... Any help?

Pierre.Vriens
  • 2,117
  • 75
  • 29
  • 42
Manu_CS
  • 1
  • 1

1 Answers1

0

I thought the best would be to consider the difference (repaired vs. not repaired) in the Agent, but then I can't work with it in the Main agent...

This is actually the correct approach. You need to create a custom agent type, give in a boolean variable isRepaired (or similar) and then in the delay you can dynamically adjust the duration using that characteristic:

agent.isRepaired ? 0. : 100 

This will delay normal agents by 100 time units and repaired agents not at all.

Obviously, you must make sure that the agents flowing through the flow blocks are of your custom agent type (see the help how to do that)

Benjamin
  • 10,603
  • 3
  • 16
  • 28
  • Thank you very much Benjamin, but the problem is that I can't do it: - In the station, if I indicate "Agent" as the Material Type Element and I write agent.repairedfromCLT? 0. : triangular( 109.1, delaytime_bec, 307.6) Then I get the error "repairedfromCLT can not be resolved" - In the station, if I indicate "Battery" (the name of my agent) as the Material Type Element and I write the same than before, then I get that "ConveyorSimpleStation(ConveyorPath, ShapeDrawMode, boolean, double, double, Color, Color, ConveyorSimpleStationDescriptor) is not defined" – Manu_CS Aug 27 '21 at 10:27
  • Looks like you are still struggling with some basics of OOP in AnyLogic. Suggest you study some of the tutorials first to see how to go about it, when to use which keywords. Also check https://www.benjamin-schumann.com/blog/2016/2/4/the-magic-lightbulb-and-how-it-can-help-your-anylogic-modelling – Benjamin Aug 27 '21 at 11:08