static IEnumerable<Event> Machine(Environment env, Resource packer) { while (true) { yield return env.TimeoutNormalPositive(MachineProcTimeMu, MachineProcTimeSigma); var token = packer.Request(); yield return token; delay += env.Now - token.Time; env.Process(Pack(env, packer, token)); } }
static IEnumerable<Event> Pack(Environment env, Resource packer, Request token) { yield return env.TimeoutNormalPositive(PackerProcTimeMu, PackerProcTimeSigma); packer.Release(token); }