AnyLogic
Expand
Font size

Material item dimensions

Since material items are typically handled in the physical space (they are transported by conveyors and occupy a certain space on them), the dimensions of the material items are essential to obtain valid simulation results. The size of each material item is defined by three dimensions (length, width, height), which are set to 1 meter by default.

Setting dimensions for the material items

Dimensions of the custom material item type are defined in the Dimensions and movement section of the custom type's properties.

In case you do not require custom types of material items, the material items in your model will have the default size of 1*1*1 meter.

You can adjust the item's dimensions (of both default and custom types) in either of the following ways (new dimensions override the dimensions previously defined in the custom type properties):

Generating material items of a custom size

Typically material items are generated by the Source block of the AnyLogic Process Modeling Library. You can set the material item dimensions right upon its creation by adjusting the properties of the corresponding Source block.

To set the new length, width, and height of the material items being created by the Source block, expand the Agent section of the block's properties, select the Set dimensions option and specify the values in the fields below.

Changing / obtaining the dimensions programmatically at model runtime

You can obtain and adjust the current dimensions of existing material items by calling the corresponding functions of the material item:

Dimensions
Function Description
void setDimensions(double lengthInMeters, double widthInMeters, double heightInMeters) Sets new dimensions of the material item, in meters.

Parameters:
lengthInMeters — new length, in meters
widthInMeters — new width, in meters
heightInMeters — new height, in meters
void setDimensions(double lengthInUnits, double widthInUnits, double heightUnits, LengthUnits units) Sets new dimensions of the material item, in the given length units.

Parameters:
lengthInUnits — new length, in meters
widthInUnits — new width, in meters
heightInUnits — new height, in meters
units — one of length unit constants
Height
Function Description
double getHeight() Returns the height of the material item.
double getHeight(LengthUnits units) Returns the height of the material item, measured in the given length units.

Parameter:
units — one of length unit constants
void setHeight(double heightInMeters) Sets the new height of the material item, in meters.

Parameter:
heightInMeters — new height, in meters
void setHeight(double heightInUnits, LengthUnits units) Sets the new height of the material item.

Parameters:
heightInUnits — new height, in specified length units
units — one of length unit constants
Width
Function Description
double getWidth() Returns the width of the material item.
double getWidth(LengthUnits units) Returns the width of the material item, measured in the given length units.

Parameter:
units — one of length unit constants
void setWidth(double widthInMeters) Sets the new width of the material item, in meters.

Parameter:
widthInMeters — new width, in meters
void setWidth(double widthInUnits, LengthUnits units) Sets the new width of the material item.
Parameters:
widthInUnits — new width, in specified length units
units — one of length unit constants
Length
Function Description
double getLength() Returns the length of the material item, measured in meters.
double getLength(LengthUnits units) Returns the length of the material item, measured in the given length units.

Parameter:
units — one of length unit constants
void setLength(double lengthInMeters) Sets the new length of the material item, in meters.

Parameter:
lengthInMeters — new length, in meters
void setLength(double lengthInUnits, LengthUnits units) Sets the new length of the material item.

Parameters:
lengthInUnits — new length, in specified length units
units — one of length unit constants
How can we improve this article?