Skip to content

Commit

Permalink
Change AllocationExpression to provide no utility.
Browse files Browse the repository at this point in the history
  • Loading branch information
sukritkalra committed Jan 1, 2024
1 parent bcad160 commit f1eead1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions schedulers/tetrisched/src/Expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1402,10 +1402,16 @@ ParseResultPtr AllocationExpression::parse(
parsedResult->type = ParseResultType::EXPRESSION_UTILITY;
parsedResult->startTime = startTime;
parsedResult->endTime = endTime;

// Construct the Utility function for the Allocation expression.
// NOTE (Sukrit): We assign a utility of 0 here since AllocationExpression
// only adds constraints into the model and does not predicate the constraints
// on any indicator. As a result, the solver has nothing to minimize or
// maximize.
parsedResult->utility =
std::make_shared<ObjectiveFunction>(ObjectiveType::OBJ_MAXIMIZE);
(parsedResult->utility).value()->addTerm(1);
(parsedResult->utility).value()->setUpperBound(1);
(parsedResult->utility).value()->addTerm(0);
(parsedResult->utility).value()->setUpperBound(0);
parsedResult->indicator = 1;

// Add the allocation variables to the CapacityConstraintMap.
Expand Down

0 comments on commit f1eead1

Please sign in to comment.