0

I am working on an model where a plane must move to a gate. The plane has its destination gate set as its parameter.

When I try to programmatically assign the gate to the moveTo's self.DEST_NODE, I get what I think is a type error.

I'm quite new to Java, and think the problem might be in the code.

Additional information: when I add no program but simply fill the node field with p_Gate1 then the program works.

I am very interested in converting the PointNode type to a moveTo.Destination type or something similar.

Ps. Thanks to Benjamin Schumann, I can now select between two options, but I would like all five gates enabled. (agent.gate==1 ? p_Gate1 : p_Gate2)

Please see attached screenshot. Thanks in advance.

Screenshot with errors

Pawel Veselov
  • 3,996
  • 7
  • 44
  • 62
Msterup
  • 1
  • 1

1 Answers1

1

You can use the same code with nested conditions for 5 gate options as follows:

agent.gate==1 ? p_Gate1 : agent.gate==2 ? p_Gate2 : agent.gate==3 ? p_Gate3 : agent.gate==4 ? p_Gate4 : p_Gate5
Emile Zankoul
  • 2,161
  • 2
  • 6
  • 18