Git Product home page Git Product logo

gsharma007 / single_use_systems_simulation_modeling_and_optimization Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 24.58 MB

Discrete Event Simulation | Queue Modeling | Bayesian Optimization | Full Factorial Design. "Design and Operation of Individualized Single-use Systems: Car-T Cell Therapy". Modeling Single-use systems using stochastic optimization techniques.

Python 100.00%
simulation-modeling queuing-theory discrete-event-simulation design-of-experiments event-based-scheduler bio-manufacturing immunotherapy

single_use_systems_simulation_modeling_and_optimization's People

Contributors

gsharma007 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

smseptember

single_use_systems_simulation_modeling_and_optimization's Issues

Yield Curve Function Not Returning Correct Value

Yield Curve Function Should return the time values and yield values for the 3 cases in the curve, which will then be utilized to finalize the processing time and Ytilda value.

Correct the code to get the right values.

Add the washing time logic

  1. Add washing time if the machine is used before
  2. Prefer not used machines over the used ones
  3. Specify Machines as Single-use and Disposable. Then prefer the single-use ones always over the disposable ones.

Setup time generation issue

Setup time is generated according to the number of machines and number of customers, and hence there is no change in the system by changing the number of operators which should not be the case since it is a shared resource.

alpha_up values for Yield curve- Iterate again for more sense

aplha_low values make a bit sense, but certainly not the alpha_up values.

Considering the curve, it seems like the values for the aplha_up should be negative considering that the slope of the curve is negative.

Also, check the sanity of alpha_low values together

Effect of Number of Machines Since we choose T from the Yield curve

Out of three times(t_low, t_normal, and t_up) calculated from the yield curve. We choose one of the t based on the patient mix policy and the selected time works as the processing time for that patient.

In this scenario, does the machine allocation logic makes any sense?

Let's say I have 5 machines. Any of the machines are chosen based on availability but the processing time for that machine is just one value.

Creating a new request under same patient ID if the test fails

At any point in the system, if the test fails, there will a new request made for a new sample and the process will start from the beginning step, but since the patient is the same, the requests have to be made under the same patient ID.

Include this logic.

Too many sample rejection

Screen Shot 2020-05-25 at 5 49 44 AM

It has to do with the values considered during the logic of test results. We compare the patients_target_bc and yield from manufacturing. The way logic is defined, it looks like its biased towards selecting rejection.

Generate the estimated count of the yield in prior for comparison

https://github.com/gsharma007/Clinic_Simulation/blob/156d6657e78eb05420665f1a950bdefb208831ff/Bio_Mfg_V12.py#L23

  • Generate the estimated yield of the overall process as well as for the individual steps.
  • Overall yield can be generated using triangular distribution using lower and upper bound in the input as +-30%
  • The individual step yield can be estimated by taking the percentage of overall yield, like
    Harvesting yield = 0.85*(overall yield)
    Cryo yield = 0.95*(harvesting yield)

Queue Termination Condition

Add the termination condition properly in order to generate all the relevant events for each patient. Currently, since the iteration is based on the indexed service time value, it stops after service time array stops.

Queue_track_length

Check the Queue_track_length

  • The event calendar ends when the queue level becomes zero. Departures equal to the len(num_machines), remains.

Check if service time generation is correct

Service time generation is an array, generated according to the number of machines and for each customer. According to the chosen machine and the customer, the service time is populated. Is it correct?

3D array or 2D array

https://github.com/gsharma007/Clinic_Simulation/blob/678612367525af338127a158b4c4663125f77e6e/PGA1.py#L31

It makes sense to relate set-up times to the operators rather than machines. But for each machine operator might have different set-time, hence which array to be generated for the set-up time.
Although it is sure, that operator's experience matters and set-up time will depend on that.

setup_times = np.random.exponential(scale=0.5, size=(NUM_MACHINES, NUM_CUSTOMERS))
or
setup_times = np.random.exponential(scale=0.5, size=(NUM_MACHINES, ))
or
setup_times = np.random.exponential(scale=0.5, size=(NUM_CUSTOMERS, NUM_Operators, NUM_MACHINES))

Verify the resource allocation logic

The logic works better for the initial steps of the process but does not work when proceeding into the last steps and the time results for the overall process are showing irrelevant values, check the sanity of data as well the logic behind it to track down the issue.

Which set of results to consider during the rework??

When rework happens, there are multiple rows of results related to the same patient. Do all the rows contribute to the results or only the last one??

What to keep and What not to??
How does that affect the queue and utilization

Testing Busy Operator Case

Not able to test the case where the operator is busy when the arrival happens. Every time arrival happens before the setup is done.

  • Although as of now, the setup for the new customer starts if some machine is free despite both the operators are free, which is good.- Mandates the case that there can not be a difference between setup and service, if the setup is done, service should happen immediately after that.

Include two levels for yield curve

`def yield_curve_level(Yield_Curve_MFG,patients_target_bc):

if Yield_Curve_MFG == 1:

    #defining characteristics for yield curve 1 (Stressed System)
    #Relaxed alpha low, less delta t, and high alpha up

    alpha_low_mfg = 100000 
    alpha_up_mfg = 4000

    t_low_mfg = []
    for j in range(NUM_PATIENTS):
        t_low_mfg.append(j/alpha_low_mfg)

    delta_t_mfg = 5

    t_up_mfg = []
    for k in t_low_mfg:
        t_up_mfg.append(k+delta_t_mfg)
    #print("t_up : \n", t_up)

    low_level_factor_mfg = 0.90
    up_level_factor_mfg = 1.10


    t_low_new_mfg = []
    for t1 in t_low_mfg:
        t_low_new_mfg.append(t1*low_level_factor_mfg)
    #print("t_low_new : \n", t_low_new)

    t_up_new_mfg = []
    for t2 in t_up_mfg:
        t_up_new_mfg.append(t2*up_level_factor_mfg)
    #print("t_up_new : \n", t_up_new)

    t_normal_mfg = []
    for a in range(NUM_PATIENTS):
        t_normal_mfg.append((t_up_new_mfg[a]+t_low_new_mfg[a])/2)


else:

    #defining characteristics for yield curve 2 (relaxed system)
    #Sharp alpha low, more delta t, and relaxed alpha up

    alpha_low_mfg = 50000 
    alpha_up_mfg = 20000

    t_low_mfg = []
    for j in range(NUM_PATIENTS):
        t_low_mfg.append(j/alpha_low_mfg)

    delta_t_mfg = 15

    t_up_mfg = []
    for k in t_low_mfg:
        t_up_mfg.append(k+delta_t_mfg)
    #print("t_up : \n", t_up)

    low_level_factor_mfg = 0.90
    up_level_factor_mfg = 1.10


    t_low_new_mfg = []
    for t1 in t_low_mfg:
        t_low_new_mfg.append(t1*low_level_factor_mfg)
    #print("t_low_new : \n", t_low_new)

    t_up_new_mfg = []
    for t2 in t_up_mfg:
        t_up_new_mfg.append(t2*up_level_factor_mfg)
    #print("t_up_new : \n", t_up_new)

    t_normal_mfg = []
    for a in range(NUM_PATIENTS):
        t_normal_mfg.append((t_up_new_mfg[a]+t_low_new_mfg[a])/2)

time_level_patients_mfg = np.array((t_low_new_mfg, t_normal_mfg, t_up_new_mfg), dtype=float)
time_level_patients_mfg = np.transpose(time_level_patients_mfg)

y1_mfg = alpha_low_mfg * (time_level_patients_mfg[:,0])
y2_mfg = patients_target_bc
y3_mfg = patients_target_bc - alpha_up_mfg*(time_level_patients_mfg[:,2])

yield_mfg = np.array((y1_mfg,y2_mfg,y3_mfg))
yield_mfg = np.transpose(yield_mfg)

return time_level_patients_mfg, yield_mfg`

Event Calendar should be included

Complete the following tasks to address the above requirement:

  1. Make a new ERG representing the current system.
  2. Check if the event calendar is made after the generation for tracking the events only or it is used in the logic itself to check or do the assignment.
  3. The event calendar will be of the following form:
    [Entity/Patient Number, Event time, Event Type]
  • The event types include Arrival, Start, Departure.
  1. Changes in the current model:
    a) Generating setup time on going
    b) use offline processing time
    c) Add data structure to include an event calendar, Queue level, Server Availability
    d) Closing the simulation at the right point, i.e. values for each patient are generated
    d) Fix the logic to get correct values
    e) Test the values

Enhancement:
f) Make graphs for b(t) and Q(t)

Representing Event Types

Event type can be, Arrival, Service Start, Departure.

  • When a person departs, and if the queue >0 then two types(Departure and Service Start), will happen at the same time, how to show this kind of event in the event calendar?

[Event time, Departure_Ci & Service_Start_Cj ]
Is this representation correct?

Change Patient Mix Levels from 3 to 2

#Factor 2- Patient Component- Two Levels
#Level 1 shows a mix of patients with 80% Average response, 10 % Good and 10% Bad response
#Level 2 shows a mix of patients with 50% Average response, 25 % Good and 25% Bad response

Logic to include contamination probability

  1. Adding Column for tracking the contamination within the sample
  2. Contamination happens only when we move forward in the process
  3. Like QM Policy 3, with a 30% probability, we do not take the test. Although, in this case, we are passing the sample in some scenarios where the sample does not meet expectations in most of the scenarios, by not conducting the test, we are avoiding the contamination.
  4. If we conduct the test, we are inducing the contamination in the sample with some probability Yha.
  5. Logic
    Generate U(0,1)
    If U <= Yha
    Sample is contaminated
    else
    The sample is not contaminated

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.