Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

newRollUp and createSubset need to apply costMultiplier updates #768

Open
ryankwagner opened this issue Mar 17, 2021 · 2 comments
Open

newRollUp and createSubset need to apply costMultiplier updates #768

ryankwagner opened this issue Mar 17, 2021 · 2 comments

Comments

@ryankwagner
Copy link
Collaborator

ryankwagner commented Mar 17, 2021

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.

@ryankwagner
Copy link
Collaborator Author

Referenced here:
#769

@ryankwagner
Copy link
Collaborator Author

@patelh @pranavbhole

Please comment if you see anything that looks strange or anything that should be added. Also please add in anybody else who would find clear use from looking at this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant