- #1
ORF
- 170
- 18
Hello
I am not sure about what should be the best format for a input text file. I think before start shooting in the dark, it's better to ask experienced people.
The (C++) program has to create a net. The nodes will be defined in a input text file.
For convenience, the net will be a bunch of std::vector (so each path inside the net, starting from the first node, will correspond to a single std::vector). I know a bunch of std::vector is not the best way of storing a net, but it's the best way for the function which will use the net.
The nodes may be connected up to 4 nodes.
I thought in three different input format, but I don't know what could be the best option, and if the input format can be optimized:
-JSON: the nodes can be defined one-by-one. In addition to the node information, the next nodes should be defined. The problem of defining the nodes individually is that you should create the net at runtime. The net is not defined in a visual/intuitive-way (that means the probability of writing a wrong input is high).
-XML: implementing hierarchy is relatively easy, but for such number of connections, the problem is similar to the previous option: the net is not defined in a visual/intuitive-way.
-CSV: as a primitive version of JSON format.
To sum up, I think JSON would be the best option, but a strict control section is needed. I don't know if there are other ways of defining a net/tree from a text file.
Thank you for your time.
Regards,
ORF
I am not sure about what should be the best format for a input text file. I think before start shooting in the dark, it's better to ask experienced people.
The (C++) program has to create a net. The nodes will be defined in a input text file.
For convenience, the net will be a bunch of std::vector (so each path inside the net, starting from the first node, will correspond to a single std::vector). I know a bunch of std::vector is not the best way of storing a net, but it's the best way for the function which will use the net.
The nodes may be connected up to 4 nodes.
I thought in three different input format, but I don't know what could be the best option, and if the input format can be optimized:
-JSON: the nodes can be defined one-by-one. In addition to the node information, the next nodes should be defined. The problem of defining the nodes individually is that you should create the net at runtime. The net is not defined in a visual/intuitive-way (that means the probability of writing a wrong input is high).
-XML: implementing hierarchy is relatively easy, but for such number of connections, the problem is similar to the previous option: the net is not defined in a visual/intuitive-way.
-CSV: as a primitive version of JSON format.
To sum up, I think JSON would be the best option, but a strict control section is needed. I don't know if there are other ways of defining a net/tree from a text file.
Thank you for your time.
Regards,
ORF