Creating custom pedestrian types

To define a custom pedestrian type

  1. Drag the Pedestrian Type from the Pedestrian Library palette into the graphical editor.

  2. The New agent dialog box will be shown.
  3. On the first page of the wizard, specify Agent type name (e.g. Passenger). Click Next.

  4. Choose the animation for the pedestrians of this type. If you want the pedestrians to be animated both in 2D and 3D, choose 3D and select 3D animation shape from the list below. If you do not plan to create 3D animation for your model, choose None. Having completed the pedestrian type creation, you will be able to draw 2D animation on the pedestrian type diagram (we recommend to put a small circle with Radius: 2 in the point (0,0)).

  5. Finished with choosing the animation, click Next to proceed to the next step.
  6. Specify the parameters for this agent type. Click <add new> in the list to create new parameter. Having selected a parameter in this list, you can set its name, type, and initial value using the controls in the right panel. Click the button to remove a parameter from the list.

  7. Click Finish.

The graphical diagram of the created pedestrian type will open. You will see there the chosen pedestrian animation and the parameters you have defined in the Pedestrian Type Wizard.

Accessing parameters of custom pedestrians in the flowchart block parameters

To generate the pedestrians of a custom type, you must choose this type in the New pedestrian parameter of the corresponding PedSource block. The pedestrians in this flowchart will be of this custom type and you will be able to use the ped local variable in the flowchart blocks to explicitly address the additional functionality of this pedestrian type.

For example, we specify Passenger in the New pedestrian field of the PedSource block in the flowchart below. Now all pedestrians in this process will be of the Passenger type. If you have defined the timeArrived and waitingTime parameters in the Passenger pedestrian type, you will be able to store the time pedestrian waits in the block by writing simple code like ped.timeArrived = time() in the On enter parameter of the PedWait and ped.waitingTime = time()-ped.timeArrived in its On exit parameter.

Note: If some pedestrians in the flow have are of the Customer type, and some, say, of the Staff type, you should leave the New pedestrian default value (Agent) and analyze the type manually by writing e.g.:
if( ped instanceof Passenger ) ((Passenger)ped) waitingTime = time() - ((Passenger)ped).timeArrived