Code Monkey home page Code Monkey logo

tmgen's People

Contributors

progwriter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tmgen's Issues

Cannot Install from pip

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/

Usage of gravity model for the generation of traffic matices is different from the reference "Simplifying the synthesis of Internet traffic matrices"

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.

ValueError

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.