Anylogic traffic software paramters not specified

303 Views Asked by At

I am trying to do a similar simulation to this.

Parking randomly in Anylogic

in addition, I would also want to generate graphs for the output i.e total number of cars leaving the car park garage.

I am facing the issue of "Description: Parameter type is not specified" under the "isThereParking" function from the solution above.

Also the error "Description: Void methods cannot return a value.- Function" for the "selectRandomParkinSpace" Function

What should be the return for both these functions?

Thank you for helping!

boolean 
 isThereParking( ~Object~  ) { 

for(ParkingLot p : parkingSpaces){
    if(p.nFree()>0)
        return true;
} 
return false; 
  }

Description: Syntax error, insert "... VariableDeclaratorId" to complete FormalParameterList. - Agent Type

1

There are 1 best solutions below

0
On

It seems to me that you are not sure how to properly set up a function with the graphical function symbol. The function name, input and output parameters are defined in the fields of the function's properties section, not in the code itself if you use this module. Have a look at the screenshot:

enter image description here

I marked the name definition, the return parameter definition and then the input parameter definition.

One thing that is unclear to me however is why you want an input parameter of type object, but do not give it a name or use it for anything...not sure what you want to do with this.