Hello,
I didn't really know how to explain in the title, but here is my problem:
I want to solve a Bike-Station-repositioning-problem, and as a penalty function for bikes, that can not be repositioned I want to add everything that can't be repositioned properly.
I defined my penalty function as follows:
objective function(penalty part).. sum (i, g(i) );
pf(i).. g(i) =E= s(i) - d(i);
d(i) = the desired number of bikes at each station /demand
s(i) = the number of bikes at each station after the repositioning took place
When there are less bikes afterwards I get a negative value. I want that value to be counted as positive, so it can add up with the other values, as the penalty function should grow with every demand, that can not be satisfied, something like this:
I hope i made clear, what's my problem and hope somebody can help.
Best regards
How to add up negative and positive numbers?
Re: How to add up negative and positive numbers?
Hi
Search in this forum for "absolute value" and you will find 8 pages with hits (not all relevant).
Cheers
Renger
Search in this forum for "absolute value" and you will find 8 pages with hits (not all relevant).
Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Re: How to add up negative and positive numbers?
Hi,
Five days ago Renger answered a similar question with a very nice reply:
viewtopic.php?f=9&t=11074&p=26062&hilit ... ion#p26062
If that doesn't work, just search for posts from Renger about minimization and you'll see it.
-Steve
Five days ago Renger answered a similar question with a very nice reply:
viewtopic.php?f=9&t=11074&p=26062&hilit ... ion#p26062
If that doesn't work, just search for posts from Renger about minimization and you'll see it.
-Steve
Re: How to add up negative and positive numbers?
Thank you.
I figured it out!
Best regards
I figured it out!
Best regards