Table of Contents

Table of Contents

FlexScript Class - ElevatorBank.Elevator

ElevatorBank.Elevator

Inherits from Object

Description

A class that represents an elevator member of an ElevatorBank.

Properties

bank A reference to the ElevatorBank associated with this elevator.
capacity The total capacity. This value is entered by the user in the elevator bank properties.
isGoingDown A boolean telling if the elevator is currently going down.
isGoingUp A boolean telling if the elevator is currently going up.
lastFloorZ The z location of the floor that the elevator most recently stopped at.
nextFloorZ The z location of the floor that the elevator was most recently dispatched to.
travelDirection An integer signifying the elevator's current travel direction. 1 means going up, -1 means going down. 0 means the elevator is idle.
usedCapacity The currently used capacity, i.e. the sum of the capacity usages of each traveler currently on the elevator.

Methods

canStop Returns true if the elevator can stop at the target z location and desired travel direction, given the elevator's current location and travel direction.
moveToFloor Tells the elevator to move to the target floor.

Details

Do no remove, this fixes the anchor on doc.flexsim.com

ElevatorBank.Elevator.bank

readonly ElevatorBank bank

Description

A reference to the ElevatorBank associated with this elevator.

Do no remove, this fixes the anchor on doc.flexsim.com

ElevatorBank.Elevator.capacity

readonly double capacity

Description

The total capacity. This value is entered by the user in the elevator bank properties.

Do no remove, this fixes the anchor on doc.flexsim.com

ElevatorBank.Elevator.isGoingDown

readonly int isGoingDown

Description

A boolean telling if the elevator is currently going down.

Do no remove, this fixes the anchor on doc.flexsim.com

ElevatorBank.Elevator.isGoingUp

readonly int isGoingUp

Description

A boolean telling if the elevator is currently going up.

Do no remove, this fixes the anchor on doc.flexsim.com

ElevatorBank.Elevator.lastFloorZ

readonly double lastFloorZ

Description

The z location of the floor that the elevator most recently stopped at.

Do no remove, this fixes the anchor on doc.flexsim.com

ElevatorBank.Elevator.nextFloorZ

readonly double nextFloorZ

Description

The z location of the floor that the elevator was most recently dispatched to.

Do no remove, this fixes the anchor on doc.flexsim.com

ElevatorBank.Elevator.travelDirection

readonly int travelDirection

Description

An integer signifying the elevator's current travel direction. 1 means going up, -1 means going down. 0 means the elevator is idle.

Do no remove, this fixes the anchor on doc.flexsim.com

ElevatorBank.Elevator.usedCapacity

readonly double usedCapacity

Description

The currently used capacity, i.e. the sum of the capacity usages of each traveler currently on the elevator.

Do no remove, this fixes the anchor on doc.flexsim.com

ElevatorBank.Elevator.canStop()

int canStop( double floorZ , int travelDirection )

Parameters

floorZ The desired z location to stop at.
travelDirection The desired travel direction for a request. 1 means going up, -1 means going down, 0 means to ignore desired travel direction.

Returns

int 1 if the elevator can stop at the location, 0 otherwise.

Description

Returns true if the elevator can stop at the target z location and desired travel direction, given the elevator's current location and travel direction.

This method uses several factors to determine whether the elevator can stop at a given location, as follows:

  1. If the elevator is currently idle, it will always return true.
  2. If the elevator is not idle, then the desired travel direction must match the elevator's travel direction, and the target z must be "ahead of it" given the elevator's current travel direction. In other words, if the elevator is currently going down, then the target z must be below the elevator's current location. If the elevator is going up, the target z must be above the elevator's current location.
  3. If the elevator is currently moving, then the target z location must be far enough ahead of the elevator so that the elevator can stop at the target z (given its current speed and deceleration) without going past it.
Do no remove, this fixes the anchor on doc.flexsim.com

ElevatorBank.Elevator.moveToFloor()

void moveToFloor( double floorZ )

Parameters

floorZ The desired z location to move to.

Returns

void True if the elevator can stop at the location.

Description

Tells the elevator to move to the target floor.

Since the elevator implements automatic logic for moving between floors, generally you will only use this method in the following situations.

  1. When the elevator becomes idle (the OnIdle event), you may want to send the elevator to a home location.
  2. If you want to preempt the elevator's normal behavior, because of some abnormal occurrence.