コード例 #1
0
ファイル: ModelElementBase.cs プロジェクト: JelleAdan/CSSL
 /// <summary>
 /// This constuctor is called to construct any ModelElement.
 /// </summary>
 /// <param name="parent">A reference to the parent model element.</param>
 /// <param name="name">The name of the model element.</param>
 public ModelElementBase(ModelElementBase parent, string name)
 {
     ConstructorCalls(name);
     Parent = parent ?? throw new ArgumentNullException($"Tried to construct ModelElement with name \"{name}\" but the parent ModelElement is null.");
     parent.AddModelElement(this);
     MyModel = parent.MyModel;
 }
コード例 #2
0
ファイル: ModelElementBase.cs プロジェクト: JelleAdan/CSSL
        /// <summary>
        /// Changes the parent model element of this model element to the supplied model element.
        /// </summary>
        /// <param name="newParent">The parent for this model element.</param>
        private void ChangeParentModelElement(ModelElementBase newParent)
        {
            ModelElementBase oldParent = Parent;

            if (oldParent != newParent)
            {
                oldParent.RemoveModelElement(this);
                newParent.AddModelElement(this);
                MyModel = newParent.MyModel;
            }
        }
コード例 #3
0
 public EventGeneratorBase(ModelElementBase parent, string name, Distribution interEventTimeDistribution) : base(parent, name)
 {
     this.interEventTimeDistribution = interEventTimeDistribution;
 }
コード例 #4
0
 public SchedulingElementBase(ModelElementBase parent, string name) : base(parent, name)
 {
 }
コード例 #5
0
ファイル: ModelElementBase.cs プロジェクト: JelleAdan/CSSL
 /// <summary>
 /// Removes the supplied child model element from this model element.
 /// </summary>
 /// <param name="modelElement">The model element to be removed.</param>
 private void RemoveModelElement(ModelElementBase modelElement)
 {
     modelElements.Remove(modelElement);
 }
コード例 #6
0
ファイル: ModelElementBase.cs プロジェクト: JelleAdan/CSSL
 /// <summary>
 /// Adds the supplied model element as a child to this model element.
 /// </summary>
 /// <param name="modelElement">The model element to be added.</param>
 private void AddModelElement(ModelElementBase modelElement)
 {
     modelElements.Add(modelElement);
 }
コード例 #7
0
ファイル: RLElementBase.cs プロジェクト: JelleAdan/CSSL
 public RLElementBase(ModelElementBase parent, string name, RLLayerBase reinforcementLearningLayer) : base(parent, name)
 {
     this.reinforcementLearningLayer = reinforcementLearningLayer;
 }