Adaptagrams
|
Represents an assignment of nbrs to semiaxes, and records the cost of this assignment. More...
#include <quadaction.h>
Public Member Functions | |
Assignment (const Nbrs &semis, double cost) | |
Standard constructor. More... | |
Assignment (void) | |
Default constructor. More... | |
size_t | cardinality (void) const |
Return the "cardinality" of this Assignment, i.e. the number of Nbrs assigned to semiaxes. | |
Assignment | makeUnion (const Assignment &other) const |
Create union of two Assignments. More... | |
std::string | toString (void) const |
Write a string representation, listing the id of the Nbr assigned to each semiaxis. For example if Nbrs 3, 7, 8 are assigned to semiaxes E, S, N resp., represent this as "3 7 - 8". More... | |
Represents an assignment of nbrs to semiaxes, and records the cost of this assignment.
|
inline |
Standard constructor.
[in] | semis | vector of four shared ptrs to Nbrs, representing the Nbrs assigned to the four semiaxes, starting with East and proceding clockwise. Should be equal to nullptr if no Nbr is present on a given semiaxis. |
[in] | cost | the cost of this assignment, which measures the sum of angular displacements of Nbrs from their original positions |
|
inline |
Default constructor.
Constructs an "empty" Assignment, with no Nbrs and zero cost.
Referenced by makeUnion().
Assignment Assignment::makeUnion | ( | const Assignment & | other | ) | const |
Create union of two Assignments.
References Assignment().
string Assignment::toString | ( | void | ) | const |
Write a string representation, listing the id of the Nbr assigned to each semiaxis. For example if Nbrs 3, 7, 8 are assigned to semiaxes E, S, N resp., represent this as "3 7 - 8".
References dialect::string_format().