Ciw icon indicating copy to clipboard operation
Ciw copied to clipboard

[Feature Request] Failure to start service

Open galenseilis opened this issue 2 years ago • 0 comments

Thinking about Issue 222, there is a desired behaviour. I would like there to be a way to have a service discipline behaviour in which servicing fails to start.

One option is to make that happen when the service discipline returns None.

import random

def sometimes_block(individuals, p=0.01):
    if random.random() < p:
        return None # Skip to the next event

     return individuals[0]

Another option might be for it to return a non-negative float indicating the amount of time until the service center will attempt to service again.

import random

def sometimes_block(individuals, p=0.01):
    if random.random() < p:
        return 5.0 # Delay next servicing until 5.0 units from now

    return individuals[0]

galenseilis avatar Dec 08 '23 03:12 galenseilis