Skip to content

newRollUp and createSubset need to apply costMultiplier updates #768

@ryankwagner

Description

@ryankwagner

newRollUp has an input field called costMultiplier, but the logic to apply this to its generated rollup isn't present. Need to create logic to do this.
Following:

def newRollUp(...
                , costMultiplier: Option[BigDecimal] = None
                ...
               ) : FactBuilder = {

Applies as such:

tableMap = tableMap +
        (name -> new FactTable(
          ...
          , fromTable.costMultiplierMap
          ...
      ))
      this

And should include this extra logic:

val remappedMultiplier: Map[RequestType, CostMultiplier] =
        fromTable.costMultiplierMap.map(f => (
          f._1 -> {
            val adjustedLRL: LongRangeLookup[BigDecimal] = LongRangeLookup(f._2.rows.list.map(row => (row._1, row._2 * costMultiplier.getOrElse(1))))
            CostMultiplier(adjustedLRL)
          }
          )
        )

Or similar.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions