Git Product home page Git Product logo

slicesim's People

Contributors

cerob avatar emingure 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar

slicesim's Issues

To fetch realtime traffic

I would like to print the real time traffic requirement at base stations on to a file. I have some problem in getting that, is there nay way to add some few lines of code to do that. @cerob

AttributeError: 'list' object has no attribute 'size'

C:\Users\Asus\Desktop\slicesim-master\slicesim-master> python -m slicesim ..\examples\istanbul-kapalicarsi.yml

Traceback (most recent call last):
  File "C:\Users\Asus\Desktop\slicesim-master\slicesim-master\slicesim\Client.py", line 84, in iter
    self.assign_closest_base_station()
  File "C:\Users\Asus\Desktop\slicesim-master\slicesim-master\slicesim\Client.py", line 171, in assign_closest_base_station
    KDTree.run(self.stat_collector.clients, self.stat_collector.base_stations, int(self.env.now), assign=False)
  File "C:\Users\Asus\Desktop\slicesim-master\slicesim-master\slicesim\utils.py", line 36, in run
    tree = kdt(bs_coor, leaf_size=2)
  File "sklearn\neighbors\binary_tree.pxi", line 1068, in sklearn.neighbors.kd_tree.BinaryTree.__init__
AttributeError: 'list' object has no attribute 'size'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\Asus\Desktop\slicesim-master\slicesim-master\slicesim\Client.py", line 88, in iter
    yield self.env.process(self.iter())
AttributeError: 'list' object has no attribute 'size'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\Asus\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\Asus\Anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Asus\Desktop\slicesim-master\slicesim-master\slicesim\__main__.py", line 151, in <module>
    env.run(until=int(SETTINGS['simulation_time']))
  File "C:\Users\Asus\Anaconda3\lib\site-packages\simpy\core.py", line 138, in run
    self.step()
  File "C:\Users\Asus\Anaconda3\lib\site-packages\simpy\core.py", line 230, in step
    raise exc
AttributeError: 'list' object has no attribute 'size'

Code Review

I am trying to understand the simulator code for a project. I am unable to figure out the logic for the get_random_slice_index() method in main.py. It contains the following piece of code:

def get_random_slice_index(vals):
    i = 0
    r = random.random()

    while vals[i] < r:
        i += 1
    return i  

I am unable to figure out the logic for the while loop condition. Kindly assist me in the same.

Error while executing

when we give sudo python3.7 -m slicesim istanbul-kapalicarsi.yml

Traceback (most recent call last):
File "/home/antony/slicesim/slicesim-master/slicesim/Client.py", line 84, in iter
self.assign_closest_base_station()
File "/home/antony/slicesim/slicesim-master/slicesim/Client.py", line 171, in assign_closest_base_station
KDTree.run(self.stat_collector.clients, self.stat_collector.base_stations, int(self.env.now), assign=False)
File "/home/antony/slicesim/slicesim-master/slicesim/utils.py", line 36, in run
tree = kdt(bs_coor, leaf_size=2)
File "sklearn/neighbors/_binary_tree.pxi", line 1050, in sklearn.neighbors._kd_tree.BinaryTree.init
AttributeError: 'list' object has no attribute 'size'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/antony/slicesim/slicesim-master/slicesim/Client.py", line 88, in iter
yield self.env.process(self.iter())
AttributeError: 'list' object has no attribute 'size'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/antony/slicesim/slicesim-master/slicesim/main.py", line 151, in
env.run(until=int(SETTINGS['simulation_time']))
File "/usr/local/lib/python3.7/site-packages/simpy/core.py", line 254, in run
self.step()
File "/usr/local/lib/python3.7/site-packages/simpy/core.py", line 206, in step
raise exc
AttributeError: 'list' object has no attribute 'size'

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.