-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
935 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include "data/move.h" | ||
|
||
bool InsMove::operator==(const InsMove &m) const { | ||
return (order == m.order) && (old_roue == m.old_route) | ||
&& (old_pos == m.old_pos) && (new_route == m.new_route) | ||
&& (new_pos == m.new_pos); | ||
} | ||
|
||
bool InsMove::operator!=(const InsMove &m) const { | ||
return !(operator==(m)); | ||
} | ||
|
||
bool InterSwap::operator==(const InterSwap &m) const { | ||
return (ord1 == m.ord1) && (ord2 == m.ord2) | ||
&& (route1 == m.route1) && (route2 == m.route2) | ||
&& (pos1 == m.pos1) && (pos2 == m.pos2); | ||
} | ||
|
||
bool InterSwap::operator!=(const InterSwap &m) const { | ||
return !(operator==(m)); | ||
} | ||
|
||
bool IntraSwap::operator==(const IntraSwap &m) const { | ||
return (ord1== m.ord1) && (ord2 == m.ord2) | ||
&& (route1 == m.route1) && (pos1 == m.pos1) | ||
&& (pos2 == m.pos2); | ||
} | ||
|
||
bool IntraSwap::operator==(const IntraSwap &m) const { | ||
return !(operator==(m)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#ifndef _MOVE_H_ | ||
#define _MOVE_H_ | ||
|
||
class InsMove { | ||
public: | ||
InsMove(unsigned o, unsigned ro, unsigned po, | ||
unsigned rn, unsigned pn): | ||
order(o), old_route(ro), old_pos(po), | ||
new_route(rn), new_pos(pn) { } | ||
|
||
bool operator==(const InsMove&) const; | ||
bool operator!=(const InsMove&) const; | ||
unsigned order; | ||
unsigned old_route, old_pos; | ||
unsigned new_route, new_pos; | ||
}; | ||
|
||
class InterSwap { | ||
public: | ||
InterSwap(unsigned o1, unsigned o2, unsigned r1, | ||
unsigned r2, unsigned p1, unsigned p2): | ||
ord1(o1), ord2(o2), route1(r1), | ||
route2(r2), pos1(p1), pos2(p2) { } | ||
|
||
bool operator==(const InterSwap&) const; | ||
bool operator!=(const InterSwap&) const; | ||
unsigned ord1, ord2; | ||
unsigned route1, route2; | ||
unsigned pos1, pos2; | ||
}; | ||
|
||
class IntraSwap { | ||
public: | ||
IntraSwap(unsigned o1, unsigned o2, unsigned r, | ||
unsigned p1, unsigned p2): | ||
ord1(o1), ord2(o2), route(r), pos1(p1), pos2(p2) { } | ||
|
||
bool operator==(const IntraSwap&) const; | ||
bool operator!=(const IntraSwap&) const; | ||
unsigned ord1, ord2, route; | ||
unsigned pos1, pos2; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.