progwriter / tmgen Goto Github PK
View Code? Open in Web Editor NEWTMgen is a tool for generating spatial, temporal, and spatio-temporal traffic matrices.
License: MIT License
TMgen is a tool for generating spatial, temporal, and spatio-temporal traffic matrices.
License: MIT License
Hello,
Thanks for writing this code. I want to use it but I'm not able to install it right now. I downloaded the repo. I also installed cython and numpy with pip.
I'm running python version 3.5.2 and pip 19.1.1.
Here is the error I am getting when I run pip install -e .
or pip install .
ERROR: Complete output from command python setup.py egg_info:
ERROR: Compiling src/tmgen/hmc.pyx because it changed.
Compiling src/tmgen/models.pyx because it changed.
Compiling src/tmgen/tm.pyx because it changed.
[1/3] Cythonizing src/tmgen/hmc.pyx
[2/3] Cythonizing src/tmgen/models.pyx
[3/3] Cythonizing src/tmgen/tm.pyx
/Users/TomNason/GreyLambdaEnv/lib/python3.5/site-packages/Cython/Compiler/Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /Users/TomNason/Dropbox/GreyLambda/GreyLambda_git/scripts/TMgen-master/src/tmgen/hmc.pxd
tree = Parsing.p_module(s, pxd, full_module_name)
/Users/TomNason/GreyLambdaEnv/lib/python3.5/site-packages/Cython/Compiler/Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /Users/TomNason/Dropbox/GreyLambda/GreyLambda_git/scripts/TMgen-master/src/tmgen/models.pxd
tree = Parsing.p_module(s, pxd, full_module_name)
/Users/TomNason/GreyLambdaEnv/lib/python3.5/site-packages/Cython/Compiler/Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /Users/TomNason/Dropbox/GreyLambda/GreyLambda_git/scripts/TMgen-master/src/tmgen/tm.pxd
tree = Parsing.p_module(s, pxd, full_module_name)
Download error on https://pypi.python.org/simple/pytest-runner/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645) -- Some packages may not be found!
Couldn't find index page for 'pytest-runner' (maybe misspelled?)
Download error on https://pypi.python.org/simple/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645) -- Some packages may not be found!
No local packages or working download links found for pytest-runner
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/TomNason/Dropbox/GreyLambda/GreyLambda_git/scripts/TMgen-master/setup.py", line 74, in <module>
'Topic :: Software Development :: Libraries :: Python Modules'
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/Users/TomNason/GreyLambdaEnv/lib/python3.5/site-packages/setuptools/dist.py", line 315, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/Users/TomNason/GreyLambdaEnv/lib/python3.5/site-packages/setuptools/dist.py", line 361, in fetch_build_eggs
replace_conflicting=True,
File "/Users/TomNason/GreyLambdaEnv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 850, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/Users/TomNason/GreyLambdaEnv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1122, in best_match
return self.obtain(req, installer)
File "/Users/TomNason/GreyLambdaEnv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1134, in obtain
return installer(requirement)
File "/Users/TomNason/GreyLambdaEnv/lib/python3.5/site-packages/setuptools/dist.py", line 429, in fetch_build_egg
return cmd.easy_install(req)
File "/Users/TomNason/GreyLambdaEnv/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 659, in easy_install
raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pytest-runner')
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /Users/TomNason/Dropbox/GreyLambda/GreyLambda_git/scripts/TMgen-master/
Hi, Thanks for sharing code. I found there is something different from the reference "Simplifying the synthesis of Internet traffic matrices" when you generate random traffic with gravity model. Here it is:
In the reference, the author said "In fact synthesis turns out to be quite easy. We start by taking Tin(ni ) and Tout(ni ) to be independent, identicallydistributed exponential random variables for i = 1, . . . , N .The TM is then generated using (1)."
However, you generated traffic matrix like this:
cpdef TrafficMatrix random_gravity_tm
dist = numpy.random.rand(num_nodes, 1)
dist = dist / sum(dist)
The dist did not follow the exponential distribution anyway. This is my first puzzle. The second is that how can i generate traffic matrices with diagonal elements of zero. I need to use this matrices to generate traffic flow from source nodes to different destination nodse without node itself traffic in-and-out. Would you please give some explanations? Thanks.
Wayne.
I tried to install the package and followed the document at https://tmgen.readthedocs.io/en/latest/quickstart.html#download-and-installation, but it seems this can not work. No modules or available methods are inside the package.
Tried dir(tmgen), the output does not have modules like uniform.
I am wondering if how I can make it work.
Hi, I have some Link Loads data, and I want to Compute its' corresponding Traffic Matrices. How should I use this tool?
Thanks!
Fei Gui
Hi,
I'm trying to create some traffic matrices with your module but I got an error when using modulated_gravity_tm.
All the other models (random_gravity_tm, gravity_tm, uniform_tm, exp_tm, spike_tm) work correctly.
This is my code
from tmgen import modulated_gravity_tm
tm = modulated_gravity_tm(num_nodes=2, num_tms=2, mean_traffic=1.0)
and this is the error
Traceback (most recent call last):
File "/home/davide/PycharmProjects/robust-routing/data/tm_generator.py", line 11, in <module>
tm = modulated_gravity_tm(num_nodes=2, num_tms=2, mean_traffic=1.0)
File "src/tmgen/models.pyx", line 131, in tmgen.models.modulated_gravity_tm
File "src/tmgen/models.pyx", line 182, in tmgen.models.modulated_gravity_tm
File "src/tmgen/models.pyx", line 96, in tmgen.models._modulated_gravity
File "src/tmgen/hmc.pyx", line 41, in tmgen.hmc.hmc_exact
ValueError: First dimension of f and g must match
Thanks!
Best,
Davide
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.