Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Here is a sample problem description in YAML. It is complete in terms of description but the problem is too simple to optimize anything.

There are two hierarchies, one level each: [product] and [customer]

There are two spaces: ByProduct and ByProductAndCustomer. Each of them contains only the standard All scope.

In ByProduct, All scope, there is only one variable, called ListPrice. It means that list prices are defined at a product level. It is a Value Finder: list prices will vary during the optimization, to reach some criteria. List prices have strict bounds list_price_lower_bound and list_price_upper_bound which are provided by the data and may be different for each product. Value Finder parameters are defined in the code, they are the same for all the products.

In ByProductAndCustomer, All scope, there are two variables: Volume and Turnover. Their values are different for each pair of (product x customer). Volumes are fixed, they are read from historical_volume data. Turnovers are computed. They are the product of list price by volume for each pair of (product x customer), they change because of list prices changes.

There is also a TargetTurnover criterion in ByProductAndCustomer, All scope. It defines that at a level of (product x customer) the turnover value should reach the historical_turnover value.

hierarchies:
  - [product]
  - [customer]
  
spaces:
  - name: ByProduct
    dimensions: [product]
    scopes:
      - name: All
        variables:
          - name: ListPrice
            type: value_finder
            init:
              type: data
              field: historical_list_price
            min:
              type: data
              field: list_price_lower_bound
            max:
              type: data
              field: list_price_upper_bound
            parameters:
              type: explicit
              initial_amplitude:
                 type: inline
                value: 1
              minimum_amplitude:
                type: inline
                value: 0.00001
              maximum_amplitude:
                type: inline
                value: 100
              increase_coefficient:
                type: inline
                value: 1.2
              decrease_coefficient:
                type: inline
                value: 2
  - name: ByProductAndCustomer
    dimensions: [product, customer]
    scopes:
      - name: All
        variables:
          - name: Volume
            type: static
            init:
              type: data
              field: historical_volume
          - name: Turnover
            type: computed
            inputs:
              type: fixed
              variables:
                - variable: ListPrice
                  space: ProductSpace
                - variable: Volume
            computation: multiplication
        criteria:
          - name: TargetTurnover
            type: target
            on: Turnover
            target:
              type: data
              field: historical_turnover
            precision:
              type: inline
              value: 0.0
            acceptable_delta:
              type: data
              field: target_delta
            priority:
              type: data
              field: target_priority
  • No labels