Git Product home page Git Product logo

ciw's People

Contributors

alcarney avatar caipirginka avatar daffidwilde avatar drvinceknight avatar emmaaspland avatar galenseilis avatar geraintpalmer avatar gitter-badger avatar kernela avatar lieke19 avatar mhowells avatar michalispanayides avatar nikoleta-v3 avatar sluenenglish avatar timlathy 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ciw's Issues

Priority Queues

Each class can have priority associated with it.

Essentially a separate queue for each priority level at each service centre

Balking

I imagine a new key in the parameters dictionary:

'Balking_functions':[function_n1, function_n2]

where the functions take in N (number of customers in the queue currently) return a probability of balking.

Reneging

I have no clue at the moment how this would work. Something about ghosts ๐Ÿ‘ป

CiwStat - Submodule to analyse the records

_BIG PROJECT_

A submodule that provides functions / classes and methods that operate on the list of records obtained using Q.get_all_records().

Some essential features::

  • Summary stats for each node / class / class-node combo (mean, variance, etc. on waits, queue length, throughput, etc.)
  • Plot (histograms) of the above ^^^

Also maybe include some time series analysis? All with the option of adding a warmup period.

_MUCH BIGGER PROJECT_
Also include ability to take in multiple lists of records (in order to analyse multiple trials).

Bug when combining priority queues with dynamic classes

Problematic parameters:

params = {
    'Arrival_distributions': {'Class 0': [['Exponential', 1.0],
                                          ['Exponential', 1.0],
                                          ['Exponential', 1.0],
                                          ['Exponential', 1.0]],
                              'Class 1': ['NoArrivals',
                                          'NoArrivals',
                                          'NoArrivals',
                                          'NoArrivals']},
    'Service_distributions': {'Class 0': [['Uniform', 0.6, 1.1],
                                          ['Uniform', 0.6, 1.1],
                                          ['Uniform', 0.6, 1.1],
                                          ['Uniform', 0.6, 1.1]],
                              'Class 1': [['Uniform', 0.6, 1.1],
                                          ['Uniform', 0.6, 1.1],
                                          ['Uniform', 0.6, 1.1],
                                          ['Uniform', 0.6, 1.1]]},
    'Number_of_servers': [1, 1, 1, 1],
    'Transition_matrices': {'Class 0': [[0.0, 1.0, 0.0, 0.0],
                                        [0.0, 0.0, 1.0, 0.0],
                                        [0.0, 0.0, 0.0, 1.0],
                                        [1.0, 0.0, 0.0, 0.0]],
                            'Class 1': [[0.0, 0.3, 0.0, 0.0],
                                        [0.0, 0.0, 0.3, 0.0],
                                        [0.0, 0.0, 0.0, 0.3],
                                        [0.3, 0.0, 0.0, 0.0]]},
    'Priority_classes': {'Class 1': 0,
                         'Class 0': 1},
    'Class_change_matrices': {'Node 1': [[0.0, 1.0], [0.0, 1.0]],
                              'Node 2': [[0.0, 1.0], [0.0, 1.0]],
                              'Node 3': [[0.0, 1.0], [0.0, 1.0]],
                              'Node 4': [[0.0, 1.0], [0.0, 1.0]]}
}

Problem: Once changed class, customers in wrong priority queue.
Solution: Need a prev_priority_class OR current_priority_class or something in addition.

DataRecords

  • Include where customers go next
  • Include number of people at node when they leave

Add a `plot()` method to the Queueing Network

This would tap in to the networkx code and produce a graphics object:

So something like:

>>> Q = asq.Simulation(params_dict)
>>> p = Q.plot()  # This would return a networkx/matplotlib plot
>>> p.show() 
>>> p.save() # etc...

Just a nice quick way to get a visualisation of the network? As it's already networkx underneath this would be easy enough to implement (I'd like to take this one). What do you think?

The library needs to be installed to be able to run the tests

When running without installing from the base get:

======================================================================
ERROR: test_simulate_until_deadlock_method (asq.tests.test_simulation.TestSimulation)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "asq/tests/test_simulation.py", line 85, in test_simulate_until_deadlock_method
    Q = asq.Simulation(asq.load_parameters('tests/datafortesting/logs_test_for_deadlock_sim/'))
  File "asq/import_params.py", line 16, in load_parameters
    parameter_file = open(parameter_file_name, 'r')
IOError: [Errno 2] No such file or directory: '/Users/vince/src/Ciw/tests/datafortesting/logs_test_for_deadlock_sim/parameters.yml'

======================================================================
ERROR: test_simulate_until_max_time_method (asq.tests.test_simulation.TestSimulation)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "asq/tests/test_simulation.py", line 70, in test_simulate_until_max_time_method
    Q = asq.Simulation(asq.load_parameters('tests/datafortesting/logs_test_for_simulation/'))
  File "asq/import_params.py", line 16, in load_parameters
    parameter_file = open(parameter_file_name, 'r')
IOError: [Errno 2] No such file or directory: '/Users/vince/src/Ciw/tests/datafortesting/logs_test_for_simulation/parameters.yml'

----------------------------------------------------------------------
Ran 26 tests in 0.003s

FAILED (errors=18)

In other words the tests fail because of being able to find the yml files.

Rename helper functions

Hi @drvinceknight would like your opinion on this.

We currently (on restructure-inputs branch) have the following functions:

Network_From_Dictionary
Network_From_File

which both return a Network object. I don't like the names of these things.
I propose the following change:

Network_From_Dictionary -> create_network_from_dictionary
Network_From_File -> create_network_from_yml_file

and then have another main function that might look like this::

def create_network(input):
if input is yml:
create_network_from_yml_file(input)
if input is dictionary:
create_network_from_dictionary(input)

And it'll be this create_network function that most users will use.

Convert to Python 3.

Putting this here to keep track for our next sprint :) ๐Ÿฅš ๐Ÿฃ ๐Ÿฅ ๐Ÿ”

ciw.set_seed

Ciw uses two random number streams, one from the random module and one from numpy.random module. Therefore in order to replicate results users need to:

from random import seed
from numpy import random
seed(5)
random.seed(5)

I would rather this be wrapped up in ciw, so user's simply need to:

ciw.set_seed(5)

I already have this defined and using it in the test suite only. @drvinceknight you mentioned you didn't like this idea, but can't remember why? Any thoughts?

Create composite hypothesis tests

Instead of a bunch of boilerplate for a hypothesis test you could simple have:

@given(sim=simulations(max_nodes=2))
def test_...

Working on this on Axelrod at the moment it's actually pretty straightforward, here's how to build a decorator that creates a matches strategy:

from hypothesis.strategies import composite, integers, tuples, sampled_from, floats

import axelrod as axl


@composite
def matches(draw, players=axl.strategies, min_turns=1, max_turns=200, noise=False):
    strategies = draw(tuples(sampled_from(players), sampled_from(players)))
    players = [s() for s in strategies]
    turns = draw(integers(min_value=min_turns, max_value=max_turns))
    if noise:
        noise = draw(floats(min_value=0.05, max_value=1))
    else:
        noise = 0
    match = axl.Match(players, turns=turns, noise=noise)
    return match

print(matches().example())
print(matches().example().play())

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.