What's the better what to add constrains in OptaPlanner
up vote
0
down vote
favorite
I am building an OptaPlan solution for an optimization problem.
I have an List<Integer>
called weights
These are the only planning variable
in my model, all others are shadow.
I want to make sure that sum of weights (weights[0] + weights[1] + weights[2]... = 1000)
, While variables other than weights (shadow
) will make sure whats the best solution (Using SimpleScore
).
Using a simple EasyScoreCalculator
might produce a huge set to search for my problem. I believe penalizing score every time for weights[0] + weights[1] + weights[2]... != 1000
is an un-optimized (slow) method.
Whats the best way to do this.
optaplanner
add a comment |
up vote
0
down vote
favorite
I am building an OptaPlan solution for an optimization problem.
I have an List<Integer>
called weights
These are the only planning variable
in my model, all others are shadow.
I want to make sure that sum of weights (weights[0] + weights[1] + weights[2]... = 1000)
, While variables other than weights (shadow
) will make sure whats the best solution (Using SimpleScore
).
Using a simple EasyScoreCalculator
might produce a huge set to search for my problem. I believe penalizing score every time for weights[0] + weights[1] + weights[2]... != 1000
is an un-optimized (slow) method.
Whats the best way to do this.
optaplanner
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am building an OptaPlan solution for an optimization problem.
I have an List<Integer>
called weights
These are the only planning variable
in my model, all others are shadow.
I want to make sure that sum of weights (weights[0] + weights[1] + weights[2]... = 1000)
, While variables other than weights (shadow
) will make sure whats the best solution (Using SimpleScore
).
Using a simple EasyScoreCalculator
might produce a huge set to search for my problem. I believe penalizing score every time for weights[0] + weights[1] + weights[2]... != 1000
is an un-optimized (slow) method.
Whats the best way to do this.
optaplanner
I am building an OptaPlan solution for an optimization problem.
I have an List<Integer>
called weights
These are the only planning variable
in my model, all others are shadow.
I want to make sure that sum of weights (weights[0] + weights[1] + weights[2]... = 1000)
, While variables other than weights (shadow
) will make sure whats the best solution (Using SimpleScore
).
Using a simple EasyScoreCalculator
might produce a huge set to search for my problem. I believe penalizing score every time for weights[0] + weights[1] + weights[2]... != 1000
is an un-optimized (slow) method.
Whats the best way to do this.
optaplanner
optaplanner
edited Nov 10 at 20:15
asked Nov 10 at 20:08
VibeeshanRC
3,29654085
3,29654085
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
You should penalize the difference between that sum and 1000. So for example, if the weight sum in 920, penalize -80. If the weight it 1019, penalize -19.
Take a look at the cloud balancing problem, I suspect you'll need to just sum all the weights of the items that have @PlanningVariable Boolean included equal to true.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
You should penalize the difference between that sum and 1000. So for example, if the weight sum in 920, penalize -80. If the weight it 1019, penalize -19.
Take a look at the cloud balancing problem, I suspect you'll need to just sum all the weights of the items that have @PlanningVariable Boolean included equal to true.
add a comment |
up vote
1
down vote
accepted
You should penalize the difference between that sum and 1000. So for example, if the weight sum in 920, penalize -80. If the weight it 1019, penalize -19.
Take a look at the cloud balancing problem, I suspect you'll need to just sum all the weights of the items that have @PlanningVariable Boolean included equal to true.
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
You should penalize the difference between that sum and 1000. So for example, if the weight sum in 920, penalize -80. If the weight it 1019, penalize -19.
Take a look at the cloud balancing problem, I suspect you'll need to just sum all the weights of the items that have @PlanningVariable Boolean included equal to true.
You should penalize the difference between that sum and 1000. So for example, if the weight sum in 920, penalize -80. If the weight it 1019, penalize -19.
Take a look at the cloud balancing problem, I suspect you'll need to just sum all the weights of the items that have @PlanningVariable Boolean included equal to true.
answered Nov 13 at 16:44
Geoffrey De Smet
14.6k53987
14.6k53987
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53242978%2fwhats-the-better-what-to-add-constrains-in-optaplanner%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown