Comments (3)
A few options come to mind for batched servicing.
Option 1: Multiple servers
In a sense what batch processing means is that there are multiple abstract servers, which may at times mean multiple servers in Ciw being used to represent a single thing in real life that can complete multiple jobs simultaneously. This allows having multiple jobs being completed simultaneously. In Ciw this can be done by passing an argument to the number_of_servers
in the ciw.create_network
Option 2: Sequential distribution
The first approach involves using ciw.dists.Sequential
. The idea here is to precompute the service times ahead of time in sequence.
A sequence of seq = [1, 0, 0, 0, 3, 0]
would mean that 4 messages are serviced at t=1, then 2 jobs are processed at t=4. This will cycle, so if you do not want any cycling to occur then you must make the sequence longer in time than the simulation time.
Option 3: Custom distribution
If you need something like option 2 but you would rather sample the service times during the simulation than precompute them, then you can design your own custom distribution as per the docs.
from ciw.
I might have to think more service lingering time.
One simple option is to include the lingering time into the Ciw node's service time. That would be fine if you're trying to get the rate of flow of messages right, but wouldn't help if you wanted to estimate something like the difference between the service time and lingering time.
Otherwise I think you'll have to look at patching where you set the server to be off duty for some amount of time right after the completion of a service.
from ciw.
Hi @ZacAttack I think you can do this with custom service disciplines.
Please see the test case test_custom_service_discipline
on line 1243 of the file Ciw/ciw/tests/test_simulation.py
for an example of this: https://github.com/CiwPython/Ciw/blob/22536cc200ed80d97c0e7b6d3e231ea3996eb144/ciw/tests/test_simulation.py#L1243C9-L1243C39
It should be simply to add another check that says, if number of customers above a threshold, just take the customer at the head of the queue, regardless of their current waiting time.
One drawback of this method is that customers are only chosen when the choose_next_customer
methods is called. So this is really a "linger for at least" methods. e.g. "linger for at least 3 time units, and next time choose_next_customer
is called, take the first customer who has waited for at least 3 time units". So some people might wait longer than that. The choose_next_customer
methods is called when a customer arrives, leaves, or a shift change occurs.
from ciw.
Related Issues (20)
- can Ciw set a state-dependent system capacity allocation for simulation? HOT 3
- error rate HOT 4
- Wishlist for Ciw 3.0 HOT 9
- re-entrance customer with dynamic priority HOT 6
- Emulate Simpy's Machine Shop example HOT 5
- Type Annotations HOT 1
- Black Code Formatter HOT 1
- Recommended practices for model configuration storage HOT 1
- How to implement class-selective servers?
- [Question]: What happens when service discipline returns None? HOT 1
- Slotted undocumented HOT 2
- [Feature Request] Failure to start service HOT 2
- [FYI] Are there other types of blocking in queueing networks beyond Type I? HOT 1
- [Feature Request] Time/State-Dependent Baulking HOT 3
- [Media Request] Wikipedia Article HOT 3
- [FYI] Wikipedia Article Draft
- [FYI] Ciw examples of Wikipedia Articles HOT 1
- Consider getting open peer review of package by pyOpenSci HOT 2
- NumPy 2.0 Migration
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ciw.