• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# NodeState类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中NodeState的典型用法代码示例。如果您正苦于以下问题:C# NodeState类的具体用法?C# NodeState怎么用?C# NodeState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NodeState类属于命名空间,在下文中一共展示了NodeState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ApplyCoulombRepulsion

        /// <summary>
        /// Applies coulomb repulsion to both points
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <param name="k">coefficient of attraction</param>
        /// <param name="f1">Force at point a</param>
        /// <param name="f2">Force at point b</param>
        public static void ApplyCoulombRepulsion(NodeState a, NodeState b, double k)
        {
            double dx = a.Position.X - b.Position.X;
            double dy = a.Position.Y - b.Position.Y;
            double sqDist = dx * dx + dy * dy;
            if (sqDist == 0)
                return;
            double d = Math.Sqrt(sqDist);

            double mag = 1.0 / sqDist; // Force magnitude

            mag -= AttractionConstant * d; // plus WEAK attraction

            mag *= k;

            if (mag > MAGNITUDE_MAX)
                mag = MAGNITUDE_MAX; // Clip maximum

            double tempX = mag * (dx / d);
            double tempY = mag * (dy / d);

            if (!a.IsFrozen)
            {
                a.Force.X += tempX;
                a.Force.Y += tempY;
            }

            if (!b.IsFrozen)
            {
                b.Force.X -= tempX;
                b.Force.Y -= tempY;
            }
        }
开发者ID:BSick7,项目名称:KineticGraph,代码行数:41,代码来源:ForceHelper.cs


示例2: NodeComponent

 public NodeComponent(string myLevelName,string myLevelID,NodeState myNodeState,List<string> myConnectedTo)
 {
     this.name = "NodeComponent";
     levelName = myLevelName;
     id = myLevelID;
     nodeState = myNodeState;
 }
开发者ID:jdtang13,项目名称:SeniorSpringVideoGameProject,代码行数:7,代码来源:NodeComponent.cs


示例3: OnAfterCreate

        /// <summary>
        /// Initializes the object as a collection of counters which change value on read.
        /// </summary>
        protected override void OnAfterCreate(ISystemContext context, NodeState node)
        {
            base.OnAfterCreate(context, node);

            UpdateStateVariable(context, Objects.ExclusiveLimitStateMachineType_High, CurrentState);
            UpdateTransitionVariable(context, 0, LastTransition);
        }
开发者ID:OPCFoundation,项目名称:UA-.NETStandardLibrary,代码行数:10,代码来源:ExclusiveLimitStateMachineState.cs


示例4: OnAfterCreate

        /// <summary>
        /// Initializes the object as a collection of counters which change value on read.
        /// </summary>
        protected override void OnAfterCreate(ISystemContext context, NodeState node)
        {
            base.OnAfterCreate(context, node);

            this.Simulation.OnAfterTransition = OnControlSimulation;
            m_random = new Random();
        }
开发者ID:OPCFoundation,项目名称:UA-.NETStandardLibrary,代码行数:10,代码来源:BoilerState.cs


示例5: findMaxUtility

			public float findMaxUtility(NodeState futureState)
			{
				float maxUtility = float.MinValue;
		

				if (futureState.RValue != 0 && futureState.RValue > maxUtility  /*&& x_diff != -1*/) {
					maxUtility = futureState.RValue;
				}
				if (futureState.LValue != 0 && futureState.LValue > maxUtility /*&& x_diff != 1*/) {
						maxUtility = futureState.LValue;
				}
				if (futureState.FValue != 0 &&futureState.FValue > maxUtility /*&& z_diff != -1*/  ) {
						maxUtility = futureState.FValue;
				}
				if (futureState.BValue != 0 &&futureState.BValue > maxUtility/*  && z_diff != 1 */) {
						maxUtility = futureState.BValue;
				}

				if (maxUtility == float.MinValue) {
					maxUtility = float.Epsilon;
				}

				return maxUtility;

			}
开发者ID:pollend,项目名称:Parkitect_Custom_NPCS,代码行数:25,代码来源:QLearningCache.cs


示例6: OnAfterCreate

        /// <summary>
        /// Initializes the object as a collection of counters which change value on read.
        /// </summary>
        protected override void OnAfterCreate(ISystemContext context, NodeState node)
        {
            base.OnAfterCreate(context, node);

            InitializeVariable(context, BooleanValue, TestData.Variables.UserScalarValueObjectType_BooleanValue);
            InitializeVariable(context, SByteValue, TestData.Variables.UserScalarValueObjectType_SByteValue);
            InitializeVariable(context, ByteValue, TestData.Variables.UserScalarValueObjectType_ByteValue);
            InitializeVariable(context, Int16Value, TestData.Variables.UserScalarValueObjectType_Int16Value);
            InitializeVariable(context, UInt16Value, TestData.Variables.UserScalarValueObjectType_UInt16Value);
            InitializeVariable(context, Int32Value, TestData.Variables.UserScalarValueObjectType_Int32Value);
            InitializeVariable(context, UInt32Value, TestData.Variables.UserScalarValueObjectType_UInt32Value);
            InitializeVariable(context, Int64Value, TestData.Variables.UserScalarValueObjectType_Int64Value);
            InitializeVariable(context, UInt64Value, TestData.Variables.UserScalarValueObjectType_UInt64Value);
            InitializeVariable(context, FloatValue, TestData.Variables.UserScalarValueObjectType_FloatValue);
            InitializeVariable(context, DoubleValue, TestData.Variables.UserScalarValueObjectType_DoubleValue);
            InitializeVariable(context, StringValue, TestData.Variables.UserScalarValueObjectType_StringValue);
            InitializeVariable(context, DateTimeValue, TestData.Variables.UserScalarValueObjectType_DateTimeValue);
            InitializeVariable(context, GuidValue, TestData.Variables.UserScalarValueObjectType_GuidValue);
            InitializeVariable(context, ByteStringValue, TestData.Variables.UserScalarValueObjectType_ByteStringValue);
            InitializeVariable(context, XmlElementValue, TestData.Variables.UserScalarValueObjectType_XmlElementValue);
            InitializeVariable(context, NodeIdValue, TestData.Variables.UserScalarValueObjectType_NodeIdValue);
            InitializeVariable(context, ExpandedNodeIdValue, TestData.Variables.UserScalarValueObjectType_ExpandedNodeIdValue);
            InitializeVariable(context, QualifiedNameValue, TestData.Variables.UserScalarValueObjectType_QualifiedNameValue);
            InitializeVariable(context, LocalizedTextValue, TestData.Variables.UserScalarValueObjectType_LocalizedTextValue);
            InitializeVariable(context, StatusCodeValue, TestData.Variables.UserScalarValueObjectType_StatusCodeValue);
            InitializeVariable(context, VariantValue, TestData.Variables.UserScalarValueObjectType_VariantValue);
        }
开发者ID:yuriik83,项目名称:UA-.NET,代码行数:30,代码来源:UserScalarValueObjectState.cs


示例7: OnAfterCreate

        /// <summary>
        /// Called after a node is created.
        /// </summary>
        protected override void OnAfterCreate(ISystemContext context, NodeState node)
        {
            base.OnAfterCreate(context, node);

            if (this.ShelvingState != null)
            {
                if (this.ShelvingState.UnshelveTime != null)
                {
                    this.ShelvingState.UnshelveTime.OnSimpleReadValue = OnReadUnshelveTime;
                    this.ShelvingState.UnshelveTime.MinimumSamplingInterval = 1000;
                }

                this.ShelvingState.OneShotShelve.OnCallMethod = OnOneShotShelve;
                this.ShelvingState.OneShotShelve.OnReadExecutable = IsOneShotShelveExecutable;
                this.ShelvingState.OneShotShelve.OnReadUserExecutable = IsOneShotShelveExecutable;

                this.ShelvingState.TimedShelve.OnCall = OnTimedShelve;
                this.ShelvingState.TimedShelve.OnReadExecutable = IsTimedShelveExecutable;
                this.ShelvingState.TimedShelve.OnReadUserExecutable = IsTimedShelveExecutable;

                this.ShelvingState.Unshelve.OnCallMethod = OnUnshelve;
                this.ShelvingState.Unshelve.OnReadExecutable = IsTimedShelveExecutable;
                this.ShelvingState.Unshelve.OnReadUserExecutable = IsTimedShelveExecutable;
            }
        }
开发者ID:yuriik83,项目名称:UA-.NET,代码行数:28,代码来源:AlarmConditionState.cs


示例8: OnAfterCreate

        /// <summary>
        /// Initializes the object as a collection of counters which change value on read.
        /// </summary>
        protected override void OnAfterCreate(ISystemContext context, NodeState node)
        {
            base.OnAfterCreate(context, node);

            UpdateStateVariable(context, Objects.ProgramStateMachineType_Ready, CurrentState);
            UpdateTransitionVariable(context, 0, LastTransition);

            Start.OnCallMethod = OnStart;
            Start.OnReadExecutable = IsStartExecutable;
            Start.OnReadUserExecutable = IsStartUserExecutable;

            Suspend.OnCallMethod = OnSuspend;
            Suspend.OnReadExecutable = IsSuspendExecutable;
            Suspend.OnReadUserExecutable = IsSuspendUserExecutable;

            Resume.OnCallMethod = OnResume;
            Resume.OnReadExecutable = IsResumeExecutable;
            Resume.OnReadUserExecutable = IsResumeUserExecutable;

            Halt.OnCallMethod = OnHalt;
            Halt.OnReadExecutable = IsHaltExecutable;
            Halt.OnReadUserExecutable = IsHaltUserExecutable;

            Reset.OnCallMethod = OnReset;
            Reset.OnReadExecutable = IsResetExecutable;
            Reset.OnReadUserExecutable = IsResetUserExecutable;
        }
开发者ID:OPCFoundation,项目名称:Misc-Tools,代码行数:30,代码来源:ProgramStateMachineState.cs


示例9: Browser

 /// <summary>
 /// Creates a new browser object with a set of filters.
 /// </summary>
 public Browser(
     ISystemContext context,
     ViewDescription view,
     NodeId referenceType,
     bool includeSubtypes,
     BrowseDirection browseDirection,
     QualifiedName browseName,
     IEnumerable<IReference> additionalReferences,
     bool internalOnly,
     Opc.Ua.Client.Session client,
     NamespaceMapper mapper,
     NodeState source,
     NodeId rootId)
 :
     base(
         context,
         view,
         referenceType,
         includeSubtypes,
         browseDirection,
         browseName,
         additionalReferences,
         internalOnly)
 {
     m_client = client;
     m_mapper = mapper;
     m_source = source;
     m_rootId = rootId;
     m_stage = Stage.Begin;
 }
开发者ID:yuriik83,项目名称:UA-.NET,代码行数:33,代码来源:Browser.cs


示例10: OnAfterCreate

        /// <summary>
        /// Initializes the object as a collection of counters which change value on read.
        /// </summary>
        protected override void OnAfterCreate(ISystemContext context, NodeState node)
        {
            base.OnAfterCreate(context, node);

            UpdateStateVariable(context, Objects.ShelvedStateMachineType_Unshelved, CurrentState);
            UpdateTransitionVariable(context, 0, LastTransition);
        }
开发者ID:yuriik83,项目名称:UA-.NET,代码行数:10,代码来源:ShelvedStateMachineState.cs


示例11: Node

 /// <summary>
 /// Initializes a new instance of the <see cref="Core.Controllers.AStar.Node"/> class. 
 /// It set the positionI of the Node, set the node state to open and calculate the travel cost to the destination tile.
 /// </summary>
 /// <param name="location">Current PositionI of the Node.</param>
 /// <param name="endLocation">PositionI of the destination tile.</param>
 public Node(PositionI location, PositionI endLocation)
 {
     Location = location;
     State = NodeState.Open;
     H = GetTraversalCost(Location, endLocation);
     G = 0;
 }
开发者ID:Lopt,项目名称:ascendancy,代码行数:13,代码来源:Node.cs


示例12: PathNode

 public PathNode(Vector2 point, bool isWalkable, Vector2 destination)
 {
     Point = point;
     this.State = NodeState.Untested;
     this.IsWalkable = isWalkable;
     this.H = GetTransversalCost(this.Point, destination);
     this.G = 0;
 }
开发者ID:Verex,项目名称:Strategy,代码行数:8,代码来源:PathNode.cs


示例13: AttachedNode_StateChanged

		void AttachedNode_StateChanged(Node node, NodeState oldState)
		{
			if(!node.IsConnected)
			{
				_Parent._ConnectedNodes.Remove(AttachedNode);
				_Parent.StartConnecting();
			}
		}
开发者ID:xcrash,项目名称:NBitcoin,代码行数:8,代码来源:NodesGroupBehavior.cs


示例14: Node

        internal Node(string id, string name, NodeState state,	List<IPAddress> public_ips,
				List<IPAddress> private_ips, NodeDriver driver)
            : base(id, name, driver)
        {
            State = state;
            PublicIPs = public_ips;
            PrivateIPs = private_ips;
        }
开发者ID:jacksonh,项目名称:MCloud,代码行数:8,代码来源:Node.cs


示例15: NodeDescriptor

 public NodeDescriptor(IAcDomain acDomain, NodeState node)
 {
     this._acDomain = acDomain;
     if (node == null)
     {
         throw new ArgumentNullException("node");
     }
     this.Node = node;
 }
开发者ID:mingkongbin,项目名称:anycmd,代码行数:9,代码来源:NodeDescriptor.cs


示例16: Update

 void Update()
 {
     if(timeToLoneliness > 0) {
         timeToLoneliness -= Time.deltaTime;
         if(timeToLoneliness <= 0) {
             nodeState = NodeState.visited;
         }
     }
 }
开发者ID:Kahrzdn,项目名称:GameJam14,代码行数:9,代码来源:Node.cs


示例17: BaseObjectState

        /// <summary>
        /// Initializes the instance with its defalt attribute values.
        /// </summary>
        public BaseObjectState(NodeState parent) : base(NodeClass.Object, parent)
        {
            m_eventNotifier = EventNotifiers.None;

            if (parent != null)
            {
                ReferenceTypeId = Opc.Ua.ReferenceTypeIds.HasComponent;
            }
        }
开发者ID:OPCFoundation,项目名称:Misc-Tools,代码行数:12,代码来源:BaseObjectState.cs


示例18: MonitoredNode

 /// <summary>
 /// Initializes the instance with the context for the node being monitored.
 /// </summary>
 public MonitoredNode(
     IServerInternal server,
     INodeManager nodeManager,
     NodeState node)
 {
     m_server = server;
     m_nodeManager = nodeManager;
     m_node = node;
 }
开发者ID:OPCFoundation,项目名称:UA-.NETStandardLibrary,代码行数:12,代码来源:MonitoredNode.cs


示例19: OnAfterCreate

        /// <summary>
        /// Called after a node is created.
        /// </summary>
        protected override void OnAfterCreate(ISystemContext context, NodeState node)
        {
            base.OnAfterCreate(context, node);

            if (this.Respond != null)
            {
                this.Respond.OnCall = OnRespondCalled;
            }
        }
开发者ID:OPCFoundation,项目名称:UA-.NETStandardLibrary,代码行数:12,代码来源:DialogConditionState.cs


示例20: OctreeNode

 public OctreeNode(Vect3 center, Double size, NodeState state, int level, int maxLevel)
 {
     Center = center;
     Size = size;
     State = state;
     Level = level;
     MaxLevel = maxLevel;
     Children = Enumerable.Empty<OctreeNode>();
     Color = Color.Purple;
 }
开发者ID:veggielane,项目名称:OpenCAD,代码行数:10,代码来源:OctreeNode.cs



注:本文中的NodeState类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# NodeType类代码示例发布时间:2022-05-24
下一篇:
C# NodeReference类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap