38 const std::string& edgeType,
39 const std::vector<int>& parameterIds) {
42 it->second = edgeType;
50 const std::string& edgeType) {
62 std::vector<OptimizableGraph::Vertex*>& vertices) {
63 std::stringstream key;
65 for (
size_t i = 0; i < vertices.size(); i++) {
66 key << factory->
tag(vertices[i]) <<
";";
70 cerr <<
"no thing in factory: " << key.str() << endl;
74 factory->
construct(it->second._edgeTypeName);
76 cerr <<
"no thing can be created" << endl;
80 assert(it->second._parameterIds.size() == e->
numParameters());
81 for (
size_t i = 0; i < it->second._parameterIds.size(); i++) {
83 cerr <<
"no thing in good for setting params" << endl;
88 for (
size_t i = 0; i < vertices.size(); i++) e->
vertices()[i] = vertices[i];
create vertices and edges based on TAGs in, for example, a file
static Factory * instance()
return the instance
HyperGraph::HyperGraphElement * construct(const std::string &tag) const
const std::string & tag(const HyperGraph::HyperGraphElement *v) const
return the TAG given a vertex
const VertexContainer & vertices() const
bool setParameterId(int argNum, int paramId)
size_t numParameters() const
EntryMap _vertexToEdgeMap
bool addAssociation(const std::string &vertexTypes, const std::string &edgeType)
OptimizableGraph::Edge * createEdge(std::vector< OptimizableGraph::Vertex * > &vertices)
bool removeAssociation(const std::string &vertexTypes)