Ejemplo n.º 1
0
 /// <summary>
 /// Basic Construcor
 /// </summary>
 /// <param name="parentControlUnit">Parent control</param>
 /// <param name="client">Client to be served</param>
 /// <param name="server">Server performing service</param>
 public ActivityGetServed(ControlUnit parentControlUnit,
                          EntityClient client,
                          EntityServer server)
     : base(parentControlUnit, "ActivityGetServed", true)
 {
     _client = client;
     _server = server;
 } // end of Activity
Ejemplo n.º 2
0
        //--------------------------------------------------------------------------------------------------
        // Constructor
        //--------------------------------------------------------------------------------------------------

        #region Constructor

        /// <summary>
        /// Basic constructor, entities are added to model
        /// </summary>
        /// <param name="name">Name of control</param>
        /// <param name="parentControlUnit">Root control unit, null in this example</param>
        /// <param name="parentSimulationModel">Simulation model control belongs to</param>
        /// <param name="numberQueues">Number queues to be modeled</param>
        /// <param name="numberServers">Number servers to be modeled</param>
        public ControlUnitQueuingModel(string name,
                                       ControlUnit parentControlUnit,
                                       SimulationModel parentSimulationModel,
                                       int numberQueues,
                                       int numberServers)
            : base(name, parentControlUnit, parentSimulationModel)
        {
            _queues  = new List <EntityQueue>();
            _servers = new List <EntityServer>();

            for (int i = 0; i < numberQueues; i++)
            {
                EntityQueue newQueue = new EntityQueue();
                AddEntity(newQueue);
                Queues.Add(newQueue);
            } // end for

            for (int i = 0; i < numberServers; i++)
            {
                EntityServer newServer = new EntityServer();
                AddEntity(newServer);
                Servers.Add(newServer);
            } // end for
        }     // end of