2
* \brief A constraint determines a minimum or exact spacing required between
6
* Tim Dwyer <tgdwyer@gmail.com>
8
* Copyright (C) 2005 Authors
10
* Released under GNU LGPL. Read the file 'COPYING' for more information.
13
#ifndef SEEN_REMOVEOVERLAP_CONSTRAINT_H
14
#define SEEN_REMOVEOVERLAP_CONSTRAINT_H
22
friend std::ostream& operator <<(std::ostream &os,const Constraint &c);
28
Constraint(Variable *left, Variable *right, double gap, bool equality=false);
29
virtual ~Constraint();
30
inline double slack() const { return right->position() - gap - left->position(); }
38
static inline bool compareConstraints(Constraint *const &l, Constraint *const &r) {
40
l->left->block->timeStamp > l->timeStamp
41
||l->left->block==l->right->block
44
r->left->block->timeStamp > r->timeStamp
45
||r->left->block==r->right->block
48
// arbitrary choice based on id
49
if(l->left->id==r->left->id) {
50
if(l->right->id<r->right->id) return true;
53
if(l->left->id<r->left->id) return true;
60
#endif // SEEN_REMOVEOVERLAP_CONSTRAINT_H