Generated on: Thu Mar 29 07:46:58 PDT 2012 for custom file set | ||
|
||
// doxy/ or-tools/ src/ constraint_solver/ |
#include <string.h>
#include <algorithm>
#include "base/hash.h"
#include <string>
#include <vector>
#include "base/commandlineflags.h"
#include "base/integral_types.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/scoped_ptr.h"
#include "base/stringprintf.h"
#include "base/join.h"
#include "base/stl_util.h"
#include "base/mathutil.h"
#include "constraint_solver/constraint_solver.h"
#include "constraint_solver/constraint_solveri.h"
#include "util/bitset.h"
#include "util/monoid_operation_tree.h"
Go to the source code of this file.
Namespaces | |
namespace | operations_research |
Typedefs | |
typedef IndexedTask < DisjunctiveTask > | operations_research::DisjunctiveIndexedTask |
typedef IndexedTask < CumulativeTask > | operations_research::CumulativeIndexedTask |
Functions | |
DEFINE_bool (cp_use_cumulative_edge_finder, true,"Use the O(n log n) cumulative edge finding algorithm described ""in 'Edge Finding Filtering Algorithm for Discrete Cumulative ""Resources in O(kn log n)' by Petr Vilim, CP 2009.") | |
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. | |
DEFINE_bool (cp_use_cumulative_time_table, true,"Use a O(n^2) cumulative time table propagation algorithm.") | |
DEFINE_bool (cp_use_sequence_high_demand_tasks, true,"Use a sequence constraints for cumulative tasks that have a ""demand greater than half of the capacity of the resource.") | |
DEFINE_bool (cp_use_all_possible_disjunctions, true,"Post temporal disjunctions for all pairs of tasks sharing a ""cumulative resource and that cannot overlap because the sum of ""their demand exceeds the capacity.") | |
template<class Task> | |
bool | operations_research::StartMinLessThan (const IndexedTask< Task > *const w1, const IndexedTask< Task > *const w2) |
Comparison methods, used by the STL sort. | |
template<class Task> | |
bool | operations_research::EndMaxLessThan (const IndexedTask< Task > *const w1, const IndexedTask< Task > *const w2) |
template<class Task> | |
bool | operations_research::StartMaxLessThan (const IndexedTask< Task > *const w1, const IndexedTask< Task > *const w2) |
template<class Task> | |
bool | operations_research::EndMinLessThan (const IndexedTask< Task > *const w1, const IndexedTask< Task > *const w2) |
template<typename T, typename Compare> | |
void | operations_research::Sort (std::vector< T > *vector, Compare compare) |
bool | operations_research::TaskStartMinLessThan (const CumulativeTask *const task1, const CumulativeTask *const task2) |
CumulativeTask * | operations_research::MakeTask (Solver *solver, IntervalVar *interval, int64 demand) |
Cumulative. | |
int64 | operations_research::SafeProduct (int64 a, int64 b) |
Returns min(a * b, kint64max). a is positive. | |
bool | operations_research::TimeLessThan (const ProfileDelta &delta1, const ProfileDelta &delta2) |
DEFINE_bool | ( | cp_use_all_possible_disjunctions | , | |
true | , | |||
"Post temporal disjunctions for all pairs of tasks sharing a ""cumulative resource and that cannot overlap because the sum of ""their demand exceeds the capacity." | ||||
) |
DEFINE_bool | ( | cp_use_sequence_high_demand_tasks | , | |
true | , | |||
"Use a sequence constraints for cumulative tasks that have a ""demand greater than half of the capacity of the resource." | ||||
) |
DEFINE_bool | ( | cp_use_cumulative_time_table | , | |
true | , | |||
"Use a O(n^2) cumulative time table propagation algorithm." | ||||
) |
DEFINE_bool | ( | cp_use_cumulative_edge_finder | , | |
true | , | |||
"Use the O(n log n) cumulative edge finding algorithm described ""in 'Edge Finding Filtering Algorithm for Discrete Cumulative ""Resources in O(kn log n)' by Petr | Vilim, | |||
CP 2009." | ||||
) |
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. This file contains implementations of several resource constraints. The implemented constraints are: Disjunctive: forces a set of intervals to be non-overlapping Cumulative: forces a set of intervals with associated demands to be such that the sum of demands of the intervals containing any given integer does not exceed a capacity. In addition, it implements the SequenceVar that allows ranking decisions on a set of interval variables.
The argmax in energetic_end_min_opt_.
It is the index of the chosen task in the Lambda set, if any, or kNone if none.
Definition at line 394 of file resource.cc.
The argmax in energy_opt_.
It is the index of the chosen task in the Lambda set, if any, or kNone if none.
Definition at line 386 of file resource.cc.
std::vector<CumulativeIndexedTask*> by_end_max_ |
std::vector<CumulativeIndexedTask*> by_end_min_ |
std::vector<DisjunctiveIndexedTask*> by_start_max_ |
Definition at line 482 of file resource.cc.
std::vector<CumulativeTask*> by_start_min_ |
const int64 capacity_ |
int64 delta |
Definition at line 1336 of file resource.cc.
const int64 demand_ |
Definition at line 111 of file resource.cc.
scoped_array<int64> demands_ |
int64 energetic_end_min_ |
Max_{subset S of Theta} (capacity * start_min(S) + energy(S)).
Definition at line 379 of file resource.cc.
int64 energetic_end_min_alpha_ |
Energetic end min of the alpha set.
Used when swimming up only.
Definition at line 993 of file resource.cc.
int64 energetic_end_min_opt_ |
Max_{subset S of Theta, i in Lambda} (capacity * start_min(S union {i}) + energy(S union {i})).
Definition at line 390 of file resource.cc.
int64 energy_ |
Amount of resource consumed by the Theta set, in units of demand X time.
This is energy(Theta).
Definition at line 376 of file resource.cc.
int64 energy_alpha_ |
Energy of the alpha set, that is, the set of tasks whose start min does not exceed the max start min of a set with excess residual energy.
Used when swimming up only.
Definition at line 988 of file resource.cc.
int64 energy_opt_ |
int64 energy_threshold_ |
Energy threshold such that if a set has an energetic_end_min greater than the threshold, then it can push tasks that must end at or after the currently considered end max.
Used when diving down only.
Definition at line 982 of file resource.cc.
IntervalVar* interval_ |
Definition at line 81 of file resource.cc.
scoped_array<IntervalVar*> intervals_ |
const int kNone [static] |
const int64 kNotAvailable [static] |
Definition at line 931 of file resource.cc.
const int64 kNotInitialized [static] |
Definition at line 893 of file resource.cc.
const int kUnknown [static] |
Definition at line 119 of file resource.cc.
CumulativeLambdaThetaTree lt_tree_ |
EdgeFinderAndDetectablePrecedences mirror_ |
Definition at line 794 of file resource.cc.
NotLast mirror_not_last_ |
Definition at line 796 of file resource.cc.
std::vector<int64> new_est_ |
new_est_[i] is the new start min for interval est_[i]->interval().
Definition at line 606 of file resource.cc.
std::vector<int64> new_lct_ |
new_lct_[i] is the new end max for interval est_[i]->interval().
Definition at line 483 of file resource.cc.
std::vector<StartMinUpdater> new_start_min_ |
Profile profile_non_unique_time_ |
Definition at line 1515 of file resource.cc.
Profile profile_unique_time_ |
Definition at line 1514 of file resource.cc.
int64 residual_capacity_ |
Definition at line 913 of file resource.cc.
Max_{subset S of Theta} (residual_capacity * start_min(S) + energy(S)).
Definition at line 883 of file resource.cc.
const int size_ |
Number of tasks sharing this cumulative resource.
Number of tasks.
Definition at line 478 of file resource.cc.
Solver* const solver_ |
Definition at line 588 of file resource.cc.
int start_min_index_ |
Definition at line 141 of file resource.cc.
EdgeFinderAndDetectablePrecedences straight_ |
Definition at line 793 of file resource.cc.
NotLast straight_not_last_ |
Definition at line 795 of file resource.cc.
Task task_ |
Definition at line 140 of file resource.cc.
const scoped_array<CumulativeTask*> tasks_ |
ThetaTree theta_tree_ |
All the following member variables are essentially used as local ones: no invariant is maintained about them, except for the fact that the vectors always contains all the considered intervals, so any function that wants to use them must first sort them in the right order.
All of these vectors store the same set of objects. Therefore, at destruction time, STLDeleteElements should be called on only one of them. It does not matter which one.
Definition at line 479 of file resource.cc.
int64 time |
Definition at line 1335 of file resource.cc.
int64 total_ect_ |
Definition at line 218 of file resource.cc.
int64 total_processing_ |
Definition at line 217 of file resource.cc.
bool up_to_date_ |
Definition at line 1033 of file resource.cc.
UpdateMap update_map_ |
update_map_[d][i] is an integer such that if a task whose demand is d cannot end before by_end_max_[i], then it cannot start before update_map_[d][i].
Definition at line 1307 of file resource.cc.
std::vector<int64> updates_ |
Definition at line 1032 of file resource.cc.