Ejemplo n.º 1
0
 /// <summary>
 /// Constructor by parameters
 /// </summary>
 /// <param name="parameters">Node parameters</param>
 public Node(NodeParams parameters)
 {
     // TODO: Implement a class
     ID             = parameters.ID;
     RefCSysID      = parameters.RefCSysID;
     AnalysisCSysID = parameters.AnalysisCSysID;
     Coords         = parameters.Coords;
     //Type = parameters.TypeName;
 }
        public RandomPrimitiveEventGenerationService(NodeName nodeName, NodeParams nodeparams, INodeProxyProvider proxyProvider, DCEPSettings settings) : base(proxyProvider, nodeName)
        {
            this.nodeName   = nodeName;
            eventGenerators = new List <PrimitiveEventGenerator>();


            foreach (var e in nodeparams.primitiveEventNames.Zip(nodeparams.primitiveEventRates, (e, r) => new { Name = e, Rate = r }))
            {
                if (e.Rate > 0)
                {
                    eventGenerators.Add(new PrimitiveEventGenerator(e.Rate, settings.timeUnit, e.Name));
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Returns the specific creator of the node using the data contained in the passed parameters
        /// </summary>
        /// <param name="parameters">Node parameters</param>
        /// <returns>A specific instance of the node creator</returns>
        public static NodeCreator GetNodeCreatorByParams(NodeParams parameters)
        {
            NodeCreator creator = null;
            var         type    = parameters.TypeName;

            // TODO: Hide the implementation of selecting a specific creator, so that the registration of a specific type occurs somewhere in a separate place
            if (type == null)
            {
                creator = new NodeCreator(parameters);
            }
            else if (type != null)
            {
                // Do nothing
            }

            // TODO: Insert new type of nodes

            return(creator);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Protected base constructor for implementing abstract parameter passing when creating a specific node class.
 /// </summary>
 /// <param name="parameters">Node parameters</param>
 protected NodeCreator(NodeParams parameters)
 {
     nodeParameters = parameters;
 }