Google Cloud Optimization V1 Client - Class PrecedenceRule (0.3.4)

Reference documentation and code samples for the Google Cloud Optimization V1 Client class PrecedenceRule.

A precedence rule between two events (each event is the pickup or the delivery of a shipment): the "second" event has to start at least offset_duration after "first" has started.

Several precedences can refer to the same (or related) events, e.g., "pickup of B happens after delivery of A" and "pickup of C happens after pickup of B". Furthermore, precedences only apply when both shipments are performed and are otherwise ignored.

Generated from protobuf message google.cloud.optimization.v1.ShipmentModel.PrecedenceRule

Namespace

Google \ Cloud \ Optimization \ V1 \ ShipmentModel

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ first_index int

Shipment index of the "first" event. This field must be specified.

↳ first_is_delivery bool

Indicates if the "first" event is a delivery.

↳ second_index int

Shipment index of the "second" event. This field must be specified.

↳ second_is_delivery bool

Indicates if the "second" event is a delivery.

↳ offset_duration Google\Protobuf\Duration

The offset between the "first" and "second" event. It can be negative.

getFirstIndex

Shipment index of the "first" event. This field must be specified.

Returns
TypeDescription
int

hasFirstIndex

clearFirstIndex

setFirstIndex

Shipment index of the "first" event. This field must be specified.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getFirstIsDelivery

Indicates if the "first" event is a delivery.

Returns
TypeDescription
bool

setFirstIsDelivery

Indicates if the "first" event is a delivery.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getSecondIndex

Shipment index of the "second" event. This field must be specified.

Returns
TypeDescription
int

hasSecondIndex

clearSecondIndex

setSecondIndex

Shipment index of the "second" event. This field must be specified.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getSecondIsDelivery

Indicates if the "second" event is a delivery.

Returns
TypeDescription
bool

setSecondIsDelivery

Indicates if the "second" event is a delivery.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getOffsetDuration

The offset between the "first" and "second" event. It can be negative.

Returns
TypeDescription
Google\Protobuf\Duration|null

hasOffsetDuration

clearOffsetDuration

setOffsetDuration

The offset between the "first" and "second" event. It can be negative.

Parameter
NameDescription
var Google\Protobuf\Duration
Returns
TypeDescription
$this