Advertisement

08.18.2008 at 12:54PM PDT, ID: 23657530
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.6

How best to store a network model in a text format?

Asked by figmit in Design Patterns, Python Scripting Language

I am looking to store a model of a network in a txt file. I am not looking for the most efficient way, but rather, something that any program can read, as is relatively easy to setup.  I dont want to be using any form of database.

I have a small simplified river network, and i have points (x,y), and certain points are connected to others, and both the points store an attribute, as does the lines between them.
 
Im not sure if it would be a good approach to have everything in one text file, so that for example each line in the txt  has:

- unique ID # for a point
- x and y coordinate to define point
- which other points this point is it networked to ( can be 1,2,3 or 4)
- attribute of the point (elevation)

where i am sort of scratching my head is how to store attributes for the lines between points (the attribute being true/false, friction factor and length). I think it would probably be easiest to have this in a separate txt file and have some sort of algorythym to setup a simple relationship between the two? There is probably a tried and tested method of solving a problem like this, but this is my first time attempting a spatial problem that is not in a grid format.

Ultimately i would like to have a program (i will be using python) where i place a pollutant in the water at a given x,y coordinate,  then have it flow progressively in the river network, and visually represent this by having lines change color as this is happening (as the state of the line goes from false to true, as in it is true that this part of the river is now contaminated).

So what is the best way of setting this up? starting with a) any standard ways to draw the network, then b) to track how something can spread through it?

For example sake, here is something i have to work with, #=are comments, i did not include attributes here for simplicity sake and includes a few mini quesitons

UID   x    y    connectedTo

1        1,1             2                #coordinate 1 has unique identifier "1", has
                                              #coordinates at (1,1) and is linked to coordinate 2
2        2,2             1,3,6          #dont know if its good to repeat here (that 2 is connect to 1, because this
                                              #is already known to the program on the first line
3        3,4             2,4
4        4,4             3,5
5        4,5             4                #this is an end point of the network (ocean), should i be aware of any
                                              #special/tricky treatments of and end point to a network?
6        4,2             2,7,8
7        3,1             6               #end point
8        5,1             6               #end point

thank you!





Start Free Trial
[+][-]08.19.2008 at 10:09AM PDT, ID: 22261719

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.19.2008 at 10:11AM PDT, ID: 22261753

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.19.2008 at 11:10AM PDT, ID: 22262276

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.19.2008 at 01:55PM PDT, ID: 22263769

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Design Patterns, Python Scripting Language
Sign Up Now!
Solution Provided By: pepr
Participating Experts: 1
Solution Grade: A
 
 
[+][-]09.11.2008 at 09:36AM PDT, ID: 22451707

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 14-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]09.12.2008 at 11:51AM PDT, ID: 22462777

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43 / EE_QW_2_20070628