Results 1 to 2 of 2

Math Help - monte carlo simulation

  1. #1
    Member
    Joined
    Nov 2010
    Posts
    94

    monte carlo simulation

    Hello, I am currently doing my project and I need some help.
    I am trying to schedule tutors for a study room where students come in and out for helps. My goal is to schedule the tutors to maximally accomodate to the flow of students that need help with math so that each tutor is given an appropriate(also consecutive) hours of schedule. I am using monte carlo simulation for this, however I have difficulties setting up constraints and variables. First I made some R codes concerning this to first get appropriate number of tutors for each hours (as the place opens from 8 am to 7 pm). I researched how many people are coming in and out for a week and I am just going to use those numbers for my probability for each hours.

    a <- 1/5; #probability for each hour

    tutors <- 2; #at least two tutors for each hour


    cat("week", "weekday", "stock", "customers", " sold", " lost","\n");

    total_stud <- 0; # coming in and out
    total_sold <- 0; # number of questions answered for students
    total_lost <- 0; # number of questions could not be answered due to overflow

    for (week in 1:3) {
    for (weekday in 1:5) {
    for (eachhours in 1:11) {

    sold <- 0;
    lost <- 0;
    random_num <- runif(1);
    if (random_num < a)
    students <- 1
    else
    students <- 0;
    #if (eachhours == 1) {
    if (students == 1) {
    if (tutors > 0) {
    sold <- sold+1;
    tutors <- tutors-1;
    }else{
    lost = lost+1;
    }
    }
    }

    total_stud <- total_stud + students;
    total_sold <- total_sold + sold;
    total_lost <- total_lost + lost;

    cat(week,"\t", weekday,"\t", stock,"\t", students,"\t", sold,"\t", lost,"\n"); # display results for
    } # end loop on each hours
    } # endloop on weekday
    } # loop on week

    # output total statistics now....
    cat("\n totals over entire simulation:\n\n")
    cat(" customers sold lost\n")
    cat("\t",total_cust,"\t",total_sold,"\t", total_lost,"\n")

    I got this so far, however how can I change the probability for each hours and improve this???

    I don't think the code runs so far, and I am not sure if i am doing this right.

    I really want to use monte carlo simulation however if you have better idea or please help me go forward. Completely stuck and have no idea
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Junior Member
    Joined
    Oct 2008
    Posts
    26
    Awards
    1

    Re: scheduling simulation

    I understand you're trying to build a simple Monte Carlo simulation model that will help you develop insight into scheduling decisions for your tutors.

    I've done this type of thing in a wide range of contexts (including a manufacturing company, restaurants, coffee shops, politicians, etc.) PM me, and let's schedule a chat on the phone.

    I might be able to help you make the details work, in a way that is useful.

    Chris
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Monte Carlo's Simulation
    Posted in the Math Software Forum
    Replies: 1
    Last Post: May 19th 2010, 01:19 AM
  2. Replies: 3
    Last Post: March 30th 2010, 05:43 AM
  3. Method of Monte Carlo
    Posted in the Advanced Statistics Forum
    Replies: 2
    Last Post: November 23rd 2009, 08:31 AM
  4. Monte Carlo Simulation
    Posted in the Advanced Statistics Forum
    Replies: 3
    Last Post: March 10th 2009, 07:30 AM
  5. Replies: 2
    Last Post: January 23rd 2008, 04:43 AM

Search Tags


/mathhelpforum @mathhelpforum