Week 5 – Virtual network parser

The parser reads a network from a text file. The file consist of 3 parts; number of nodes, node data and linking data.

Number of nodes
This value is located on the first row. This is the amount of nodes in the network.
< N >

Node data
This starts on the second row and continues for the number of nodes.
< x0 > < y0 > < z0 > < difficulty0 > < increase0 > < decrease0 > < detection0 >

< xN > < yN > < zN > < difficultyN > < increaseN > < decreaseN > < detectionN >

Link data
Last in the file is the links located, each row representing an index. The row starts off with the number of links the node will have and after it comes the index to the node. If a node will have no links the row must start with the value 0.
< links0 > < linkIndex0 > < … > <linkIndexN >

< linksN > < linkIndex0 > < … > < linkIndexN >

 

Example:
4
  -1.0    30.0      2.0   1.0     1.0     1.0     100.0
   0.0    30.0   -10.0   1.0     1.0     1.0     100.0
-10.0    30.0     -5.0   1.0     1.0     1.0     100.0
-16.0    30.0      7.0   1.0     1.0     1.0     100.0
3   1   2   3
1   0
1   0
1   0
ANN_learning_parser_example

Leave a Reply

Your email address will not be published. Required fields are marked *