import scalation.simulation._ import scalation.mathstat._ object Bank extends Application { val director = new Model ("bank") val entry = new Source ("entry", director, Customer, 100, Array (100, 100, 30, 30), Uniform (4000, 6000)) val tellerQ = new WaitQueue ("tellerQ", Array (210, 100, 80, 30)) val teller = new Resource ("teller", tellerQ, 1, Array (290, 100, 30, 30), Uniform (9000, 11000)) val door = new Sink ("door", Array (400, 100, 30, 30)) val entry2tellerQ = new Path ("entry2tellerQ", entry, tellerQ, Uniform (900, 1100)) val teller2door = new Path ("teller2door", teller, door, Uniform (900, 1100)) director.addComponents (List (entry, tellerQ, teller, door, entry2tellerQ, teller2door)) case class Customer () extends SimActor ("c", director) { def act () { entry2tellerQ.move () if (teller.busy) tellerQ.waitIn () teller.utilize () teller.release () teller2door.move () door.leave () } // act } // Customer director.startSim () } // Bank