Function readAgents(const std::string&, std::vector<unsigned>&, std::vector<unsigned>&, std::vector<int>&, std::vector<double>&, std::vector<double>&, std::vector<double>&, std::vector<double2>&, std::map<std::string, int32_t>&)

Function Documentation

int readAgents(const std::string &file, std::vector<unsigned> &nShapesPerAgent, std::vector<unsigned> &shapeIDagent, std::vector<int> &edges, std::vector<double> &radii, std::vector<double> &masses, std::vector<double> &mois, std::vector<double2> &delta_gtos, std::map<std::string, int32_t> &materialMapping)

Reads the Agents XML file.

Parameters:
  • file -- The name of the file

  • nShapesPerAgent -- The number of shapes by agent (size: number of agents)

  • shapeIDagent -- A correspondence between the shape ids (index) and the agent (value) (size: number of shapes)

  • edges -- The indices of the first shape for each agent (size: number of agents + 1)

  • radii -- The radii of all shapes (size: number of shapes)

  • masses -- The masses of the agents

  • mois -- The moment of inertia of the agents

  • delta_gtos -- The relative positions of the shapes with respect to the center of mass of each agent

  • materialMapping -- The known mapping between user-provided material ids and our ids for them

Returns:

EXIT_FAILURE in case of issue in the XML file (missing or unreadable field) EXIT_SUCCESS otherwise