linopy icon indicating copy to clipboard operation
linopy copied to clipboard

Support constant values in objective

Open 0wenwu opened this issue 1 year ago • 1 comments

  1. if the problem need to convert multi-objectives to singe-objective, it's necessary to make normalization involving some constant variables. It's not conveniet to construct objective containing constant, such as x+1 Here is a trick to add constant constant_1=m.add_variables(lower=1, upper=1,name="constant_1")
  2. class Variable only have sum function, other operations are also needed, such as std

0wenwu avatar Feb 23 '24 13:02 0wenwu

@0wenwu, you are right, the current objective class does not support carrying constants. Let's leave this open and see whether there is more people who wish for this feature.

The std could be easily introduced as function. PRs are always welcome :)

FabianHofmann avatar Feb 28 '24 14:02 FabianHofmann