Designing a network in Python

2014-04-30 Thread varun7rs
Hello Friends I would like to design a network given the topology and the source I use is http://sndlib.zib.de/home.action I have managed to read most of the important data in the xml onto lists. Now, I have two lists, Source and Destination and I'd like to create bi-directional links between

Re: Designing a network in Python

2014-04-30 Thread varun7rs
I don't know how to do that stuff in python. Basically, I'm trying to pull certain data from the xml file like the node-name, source, destination and the capacity. Since, I am done with that part, I now want to have a link between source and destination and assign capacity to it. eg.,

Re: Designing a network in Python

2014-05-02 Thread varun7rs
On Wednesday, 30 April 2014 20:38:07 UTC+2, Joseph L. Casale wrote: I don't know how to do that stuff in python. Basically, I'm trying to pull certain data from the xml file like the node-name, source, destination and the capacity. Since, I am done with that part, I now want to have a

Mapping of node numbers

2014-05-06 Thread varun7rs
Hello Everyone, I need to map the node ID to a number. I am using this xml file as of now. http://sndlib.zib.de/coredata.download.action?objectName=germany50format=xmlobjectType=network Also, I need to use the same node number whenever there is a node occurrence in the source and destination.

Need help to write data onto an XML file after reading data from another xml file

2014-05-13 Thread varun7rs
Hello Users, I am in dire need of your help. I have been working on this code for quite some time and it is making me restless. All I am trying to do is, 1. Read data from an xml file. Source: http://sndlib.zib.de/coredata.download.action?objectName=germany50format=xmlobjectType=network 2.

Re: Need help to write data onto an XML file after reading data from another xml file

2014-05-14 Thread varun7rs
I try to add an edge with the source id and destination id over a loop but this is the error I am getting. And the range for the for addEdge is something I have no clue about. python export.py --output topology.xml --xml germany50.xml Traceback (most recent call last): File export.py, line

Re: Need help to write data onto an XML file after reading data from another xml file

2014-05-14 Thread varun7rs
That is a very descriptive post. Since its my first time programming I am not aware of many conventions that are being used to name classes. I tried to distinguish them by naming classes in caps. I borrowed some ideas from here and there to come up with the Approach_Read.py file. What I intend

Can't figure out 'instance has no attribute' error

2014-05-17 Thread varun7rs
Hello Friends, I am working on this code but I kind of get the same error over and over again. Could any of you help me fix this part of the error? File RW1: class PHY_NETWORK: def __init__(self, nodes, edges): self.nodes = nodes self.edges = edges def

Re: Can't figure out 'instance has no attribute' error

2014-05-18 Thread varun7rs
On Sunday, 18 May 2014 01:56:42 UTC+2, varu...@gmail.com wrote: Hello Friends, I am working on this code but I kind of get the same error over and over again. Could any of you help me fix this part of the error? File RW1: class PHY_NETWORK: def __init__(self, nodes,

Problem in writing demands to the xml file

2014-05-19 Thread varun7rs
Hello Friends, I am still working on the script to write data onto the xml file and now I've got a problem. This is how my xml file looks now but I intend to add attributes to demands. I am not able to do it properly. substrate nodes node Name=u'Aachen' ProcessingCapacity=20 StorageCapacity=38

Re: Problem in writing demands to the xml file

2014-05-20 Thread varun7rs
There is no traceback error. But I want to actually fill the demands with certain attributes which I'm not able to do. When I run the program, the xml is written but the demands doesn't have any attributes whatsoever. I could give you a clear idea of what I expect in the demands. For every

Unable to figure out ' invalid matrix input type -- ', u'1'

2014-05-28 Thread varun7rs
Hello Everyone, I am currently working on Cplex using Python API. I have a problem when I run the code. I keep getting this error about the invalid matrix input but I'm not able to figure out what it is. I would be grateful if any of you could help. My function is as below def

Segmentation fault (core dumped) while using Cplex Python API

2014-06-01 Thread varun7rs
Hello Everyone, I am trying to solve a mixed-integer problem using Cplex Python API and I get this error Segmentation fault (core dumped). i am not able to figure out the reason for this. Traceback srva@hades:~$ python RW10.py --output test --logPath log --xml topology.xml Start Time:

Having trouble in expressing constraints in Python

2014-06-03 Thread varun7rs
I have a problem in writing a constraint in Python. Firstly, I wrote the code in AMPL and it was working and I'm using Python for the reason that it is more suitable to handle large data. I managed to write the code quite fine except for one constraint(Link Mapping Constraint). I've attached

Re: Having trouble in expressing constraints in Python

2014-06-03 Thread varun7rs
Are you trying to implement your own code rather than use an existing library from pypi? I borrowed the idea from a previous file which I was working on. I input variables and coefficients as lists and then inturn as matrices to the CPLEX. So, I have a problem with expressing the

Re: Having trouble in expressing constraints in Python

2014-06-06 Thread varun7rs
Thanks a lot Ian. Your post helped me understand the problem in a much better way and I've solved the first objective thanks to you but incase of my second objective which is minimize the number of nodes, I have got one of the weirdest looking constraints which I don't know how to express in

Is this sort of a constraint implementable in Python?

2014-06-10 Thread varun7rs
Hello Everyone, I'm working on a python code to input matrices into CPLEX solver. I have most of my code running fine but as of now, I don't know how to express this constraint. My objective is to minimize the number of nodes. I have got one of the weirdest looking constraints which I don't

Checking netlists for equivalence

2014-07-18 Thread varun7rs
Hello Everyone, I have tried to understand a code but I'm finding it extremely difficult in getting it through my head. I'd be glad if any of you could help me. I understood the parsexml function and I'm trying to understand the rest but finding it very hard. If any of you could spare your

Davis putnam algorithm for satisfiability...

2014-08-04 Thread varun7rs
Hello friends, I have some trouble understanding the davis putnam algorithm for satisfiability. I understood most of the code but I don't know where exactly backtracking is happening here. Your assistance would be very helpful to me. import sys import math import copy final_list = [] def

Re: Davis putnam algorithm for satisfiability...

2014-08-05 Thread varun7rs
Thank you Cameron. Your post was very helpful. If you don't mind I'd like to ask you the purpose of the final list in the very beginning of the code. It is being updated and then checked for the presence of a literal. If a literal is found it returns not equivalent. Could you brief me the use

Representing mathematical equations

2014-10-06 Thread varun7rs
Hello, I am working on a mathematical equation which I'm finding really hard to express in python. Could any of you spare some time to help me out? The equation looks like this b(i,x) = [Σ(l∈L) [bd(l) * dist(l) * hc(l)]] / Σ(l∈L) l I have a problem in representing the above equation. I don't

Re: Representing mathematical equations

2014-10-06 Thread varun7rs
On Monday, 6 October 2014 13:14:04 UTC+2, varu...@gmail.com wrote: Hello, I am working on a mathematical equation which I'm finding really hard to express in python. Could any of you spare some time to help me out? The equation looks like this b(i,x) = [Σ(l∈L) [bd(l) *

Re: Representing mathematical equations

2014-10-06 Thread varun7rs
On Monday, 6 October 2014 15:03:44 UTC+2, varu...@gmail.com wrote: On Monday, 6 October 2014 13:14:04 UTC+2, varu...@gmail.com wrote: Hello, I am working on a mathematical equation which I'm finding really hard to express in python. Could any of you spare some time to

reading output from a .sol file

2014-10-15 Thread varun7rs
Hello everyone, I have a .sol file at my hand and I wish to make it an xml file so that its a bit more convenient to read and skim off data from an xml file. But to do that, I need to write a function to read the values in the .sol file. What I intend is when I read the line z_ something, i

Help in using grako for parsing

2014-10-17 Thread varun7rs
Hello, I am trying to parse a file which ahs the below content. I tried using the split function but that wasn't a good programming practice. I had to use it repeatedly to split the line and then read my data. I thought of doing it in a better way which is when I came across grako. But I have

Re: Help in using grako for parsing

2014-10-17 Thread varun7rs
I'm really sorry for not being clear. I shall explain things in detail from now onwards. Really sorry. The output I would like is RF schema=RF.xsd version= VNE requests request ID='0' virtualnodes virtualnode PhysicalNode_ID='1' Request_ID='0' VirtualNode_ID='0'/virtualnode PhysicalNode_ID='5'

Re: Help in using grako for parsing

2014-10-17 Thread varun7rs
Oh damn, it turned out really crappy. I could not format it properly -- https://mail.python.org/mailman/listinfo/python-list

Running a .py file iteratively at the terminal

2015-01-26 Thread varun7rs
Hello Everyone, I am running a python script as of now and I have to change three global values repeatedly. I'm tired of doing this manually. SO, I was wondering if there is a way to run a python command repeatedly. In my case, the command would be srva@hades:~$ python NFV_v3_7_10_14.py -l log

Re: Running a .py file iteratively at the terminal

2015-01-26 Thread varun7rs
Thanks a lot Mark but that would be a bit trivial. How can I run the same file multiple times? Or if I need to run two commands: srva@hades:~$ python NFV_nw_eu_v3_14_1_15.py --output eu_v3_14_1_15 --demand demands_v3_21_1_15.xml --xml nobel-eu.xml srva@hades:~$ python NFV_v3_7_10_14.py -l log

HDF5 data set, unable to read contents

2016-03-10 Thread varun7rs
Hello everyone, I recently came across a package called matrix2latex which simplifies the creation of very large tables. So, I saved my data in .mat format using the '-v7.3' extension so that they can be read by python. Now, when I try to read these files, I'm having some problems in