25 #ifndef DIALECT_QUADACTION_H 26 #define DIALECT_QUADACTION_H 31 #include "libdialect/commontypes.h" 50 std::vector<std::string>
lookupQuadActions(
size_t p,
size_t q,
size_t r,
size_t s,
size_t c);
73 Nbr(id_type
id,
double dx,
double dy);
106 Assignment(
const Nbrs &semis,
double cost) : semis(semis), cost(cost) {}
111 Assignment(
void) : semis({
nullptr,
nullptr,
nullptr,
nullptr}), cost(0) {}
192 std::vector<unsigned>
vacancy(
void)
const;
197 std::vector<unsigned>
dist(
void)
const;
203 std::vector<unsigned>
rDist(
void)
const;
248 #endif // DIALECT_QUADACTION_H Assignment makeUnion(const Assignment &other) const
Create union of two Assignments.
Definition: quadaction.cpp:80
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".
Definition: quadaction.cpp:95
const std::vector< unsigned > SEMIAXIS_SETS_BY_CARDINALITY[5]
Definition: quadaction.h:56
std::vector< unsigned > rDist(void) const
Get the "reduced distribution vector" for this Arrangement.
Definition: quadaction.cpp:192
std::vector< unsigned > dist(void) const
Get the "distribution vector" for this Arrangement.
Definition: quadaction.cpp:184
Assignment(const Nbrs &semis, double cost)
Standard constructor.
Definition: quadaction.h:106
libdialect: A library for computing human-like orthogonal network (DiAlEcT) layouts.
Definition: cola.h:44
std::vector< std::string > lookupQuadActions(size_t p, size_t q, size_t r, size_t s, size_t c)
Look up legal quad actions.
Definition: qalookup.cpp:204
Assignment constructAssignmentForAction(char action) const
Construct an Assignment indicating which Nbr(s) were assigned to which semiaxes, and representing the...
Definition: quadaction.cpp:134
double deflection(void) const
A measure of how far into its quadrant this nbr lies, in the clockwise direction. ...
Definition: quadaction.cpp:59
Nbrs nbrs
The Nbrs that lie in this quadrant.
Definition: quadaction.h:173
Nbrs semis
The semiaxes.
Definition: quadaction.h:240
Represents the arrangement of all Nbrs around a centre node.
Definition: quadaction.h:181
Represents a neighbouring node to a central node.
Definition: quadaction.h:65
void addNbr(const Nbr_SP &nbr)
Add a neighbour.
Definition: quadaction.h:147
Nbr(id_type id, double dx, double dy)
Standard constructor.
Definition: quadaction.cpp:41
Assignments computeNAssignments(unsigned N) const
Compute all possible Assignments in which precisely N semiaxes are occupied, sorted by ascending cost...
Definition: quadaction.cpp:222
double ACost
Cost for anticlockwise action.
Definition: quadaction.h:175
unsigned num
The number of this quadrant, 0, 1, 2, or 3.
Definition: quadaction.h:171
double CCost
Cost for clockwise action.
Definition: quadaction.h:177
Quad(unsigned num)
Standard constructor.
Definition: quadaction.cpp:110
std::vector< unsigned > vacancy(void) const
Get the "vacancy vector" for this Arrangement.
Definition: quadaction.cpp:174
size_t size(void) const
Say how many Nbrs are in this quadrant.
Definition: quadaction.h:150
unsigned octalCode(void) const
Definition: quadaction.cpp:49
Represents an assignment of nbrs to semiaxes, and records the cost of this assignment.
Definition: quadaction.h:95
Nbrs nbrs
All Nbrs in the Arrangement.
Definition: quadaction.h:238
Quads quads
The quadrants.
Definition: quadaction.h:242
void sortAndComputeCosts(void)
To be called after all nbrs have been added. Sorts the nbrs into clockwise order, and then computes a...
Definition: quadaction.cpp:115
Assignments computeAllAssignments(void) const
Compute all possible Assignments.
Definition: quadaction.cpp:287
Represents a quadrant, relative to a central node.
Definition: quadaction.h:139
Assignment_SP getBasicAssignment(void) const
Get the "basic Assignment" for this Arrangement.
Definition: quadaction.cpp:203
Assignment_SP getAssignmentForQuadAction(std::string quadAction) const
Get the Assignment resulting from a given quad action.
Definition: quadaction.cpp:209
size_t cardinality(void) const
Return the "cardinality" of this Assignment, i.e. the number of Nbrs assigned to semiaxes.
Definition: quadaction.cpp:68
Arrangement(Nbrs nbrs)
Standard constructor.
Definition: quadaction.cpp:152
Assignment(void)
Default constructor.
Definition: quadaction.h:111