Skip to content

'set_max_up_times()' behaves like 'set_total_max_up_times' #27

@jelgerjansen

Description

@jelgerjansen

When testing different types of combinatorial constraints, I noticed that set_max_up_times does not work as intended. The function limits the total up-time over the entire prediction horizon instead of limiting the time after activation.

I created a simple example (Python code: PycombinaTestCombinatorialConstraints.zip):
t=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
b_rel=[0.9,0.9,0.8,0.7,0.1,0.,0.,0.7,0.8]

  1. No combinatorial constraints
  • b_bin=[1. 1. 1. 0. 0. 0. 0. 1. 1.]
  • J_CIA=4.0e-1
  • Benchmark
  1. binapprox.set_min_up_times([4,0])
  • b_bin=[1. 1. 1. 1. 0. 0. 0. 0. 1.]
  • J_CIA=7.0e-1
  • Works as intended
  1. binapprox.set_max_up_times([3,0])
  • b_bin=[1. 1. 1. 0. 0. 0. 0. 0. 0.]
  • J_CIA=1.9e-0
  • According to the definition this should give the same results as 1, but this is not the case; the last two values are 0 instead of 1. This simple example indicates that set_max_up_times limits the TOTAL number of 1’s instead of per activation
  1. binapprox.set_total_max_up_times([3,0])
  • b_bin=[1. 1. 1. 0. 0. 0. 0. 0. 0.]
  • J_CIA=1.9e0
  • This gives the same result as 3, indicating that both functions lead to the same result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions