Skip to content

Fixed bug with a Vector{FutureValue} input#6

Merged
JulStraus merged 1 commit intomainfrom
fix/objective_value
Mar 4, 2026
Merged

Fixed bug with a Vector{FutureValue} input#6
JulStraus merged 1 commit intomainfrom
fix/objective_value

Conversation

@JulStraus
Copy link
Copy Markdown
Member

Problem statement

The dispatch in the function get_future_value_expression is not working when the input to the Case type is a Vector{FutureValue}. This is caused by the filter *in the function objective_operational as it returns as well a Vector{FutureValue} as can be tested with this minimum working example:

vec = Real[1, 2, 3, 4.0]
typeof(vec) # Provides `Vector{Real}`

filter(n -> isa(n, Int64), vec) # Provides still a `Vector{Real}`

Solution

Convert the vector to the corresponding type. As we filter, there is no problem. The change in the test tests this behavior.

@JulStraus JulStraus requested a review from lfbernardino March 3, 2026 15:06
@JulStraus JulStraus added the bug Something isn't working label Mar 3, 2026
Copy link
Copy Markdown
Collaborator

@lfbernardino lfbernardino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok. It doesn't seem to be an issue to replace the test for Vector{TypeFutureValue} with Vector{FutureValue}.

@JulStraus JulStraus merged commit bc88327 into main Mar 4, 2026
5 checks passed
@JulStraus JulStraus deleted the fix/objective_value branch March 4, 2026 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants