0

My objective function is comprised of conditional variables, which is causing every re-run of my python script to have slightly different variable references. I need help re-writing my objective function so that there are no conditions in it, while still keeping the same problem/solution.

ObjectiveFunction = maximize(Σ(Ψ_[p, r] * (x_bar[p, r] + c[p, r]) for p in P for r in R))

where:

  • p is a player
  • r is the round
  • Ψ is a dictionary ( Dict[Tuple[str, int], int] ) representing the score of player p in round r
  • x_bar is a binary variable ( x_bar := (p, r) ) of whether a player is counted as scoring (part of the team) in round r
  • c is a binary variable ( c := (p, r) ) representing a captain who has a doubled score in round r

I have looked at several similar questions, but have had no luck applying their answers to my problem. They are:

Thank you for taking the time to read this and help me. It truly means a lot!

3
  • I don't see the conditions in the objective function you wrote?? Commented Feb 8, 2022 at 15:39
  • Note that in general, or.stackexchange.com is a better resource than stackoverflow.com when it comes to rewriting an objective function. Commented Feb 8, 2022 at 15:39
  • Thank you for your advice Stef Commented Feb 8, 2022 at 15:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.