package edu.nyu.cs9053.concurrency.monitor;

import java.util.Random;

/**
 * User: blangel
 * Date: 11/9/14
 * Time: 3:57 PM
 */
public class ProducerLogic {

    private final Random random;

    public ProducerLogic(Random random) {
        this.random = random;
    }

    public boolean hasPassenger() {
        return (random.nextInt(100) < 75);
    }

    public void produce(Elevator elevator) {
        elevator.add(new Object());
    }

}
