NS3 Product GroupProduct Group
Overview
Product Groups are a feature which can be used to model the translation between dimensional quantities measured on various products. A typical use case for this functionality is when modelling product mass produced in one location, but ultimately delivering it in another unit (such as pallets) to a demand node. The product specification allows a user to specify the average rate at which one dimension can be converted to another (i.e. 1 unit of mass produces 0.05 pallets). This allows a user to work in different dimensions at different stages of the model. That said, more complex product specifications are considered advanced usage of the API.
Each product is required to belong to one and only one product group. In the simplest case, each product could be in its own product group - which is perfectly acceptable. In some instances it is very convenient to group products over which common constraints may apply - this simplifies other modelling constraints on lane rates which may then be applied.
Applicable models
- NS3
ns3-tbfvuwtge2iq
Product Specification
A product specification allows the user to define the ratio at which one dimensional measurement on a particular product dimension may be translated into on another dimension. This is typically used to convert mass to pallets, cartons or cases.
The product specification can be omitted in simpler models where no unit conversions between product dimensions is required.
Schema definition
message ProductSpecification{
required string baseDimension = 1;
repeated string targetDimension = 2;
repeated float targetPerBase = 3;
}Fields
- baseDimension
- The base dimension against which this product is being measured, i.e. “weight”.
- targetDimension
- The target dimension for conversion, i.e. “pallets”
- targetPerBase
- The ratio at which the base dimension should be converted to the target dimension. I.e. 0.05 would imply each unit of weight is equivalent to 0.05 pallets.
Examples
This snippet shows the configuration described above to convert weight to equivalent pallets.
productSpecification {
baseDimension: "weight"
targetDimension: "pallets"
targetPerBase: 0.05
}Product Group
A product group is used to collect similar types of products together into a collection which allows the simpler specification of constraints in a particular model. An example of this may be products which are typically constrained as a collection, such as fluid products and solid products. It may occur that limitations apply to the total number of fluid product which may be used on a particular lane rate but which individual product across the group is not constrained. Products may then be grouped together and a constraint applied on the lane rate at a product group level (which will aggregate the constraint across all products in the same group).
Schema definition
message ProductGroup {
required string productId = 1;
required string productGroupId = 2;
repeated ProductSpecification productSpecification = 3;
}Fields
- productId
- The unique identifier for the product to be assigned to the specified group. A product may only belong to a single group.
- productGroupId
- The product group identifier, used to collect products which have overlapping constraints or modelling attributes.
- productSpecification
- The product specification for the
productIdwhich indicates the ratio at which a product’s dimensions may be transformed into other dimensional quantities in the network.
Examples
This example highlights the simplest implementation for a product configuration where the product with id Beer is placed in its own product group Beer. The reason this is required by the solver is that it enforces a validation check on the input data where products are specified on the nodes. If a product has not been defined in the model at this level, the checks will report that there are products present which have not been defined.
productId: "Beer"
productGroupId: "Beer"A more complex configuration is illustrated below where two products both belong to the same product group. This allows constraints to be applied on lane rates to liquids in the model.
productId: "Beer"
productGroupId: "Liquids"
productId: "Whiskey"
productGroupId: "Liquids"