当前位置: 首页>>代码示例>>C#>>正文


C# Name.GetNTerm方法代码示例

本文整理汇总了C#中Name.GetNTerm方法的典型用法代码示例。如果您正苦于以下问题:C# Name.GetNTerm方法的具体用法?C# Name.GetNTerm怎么用?C# Name.GetNTerm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Name的用法示例。


在下文中一共展示了Name.GetNTerm方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BaseEvent

 protected BaseEvent(uint id, Name eventName, ulong timestamp)
 {
     Id = id;
     Type = eventName.GetNTerm(1);
     Subject = eventName.GetNTerm(2);
     Timestamp = timestamp;
     EventName = eventName;
 }
开发者ID:GAIPS-INESC-ID,项目名称:FAtiMA-Toolkit,代码行数:8,代码来源:BaseEvent.cs

示例2: AssertEventNameValidity

        public static void AssertEventNameValidity(Name name)
        {
            if (name.NumberOfTerms != 5)
                throw new Exception("A event name must contain 5 terms");

            if(!name.IsGrounded)
                throw new Exception("A event name cannot contain variables");

            if (name.GetNTerm(0) != EVT_NAME)
                throw new Exception("The first term of an event name must be \"Event\"");

            if (name.GetNTerm(1).IsComposed)
                throw new Exception("The second term of an event name cannot be a composed name.");

            if (name.GetNTerm(2).IsComposed)
                throw new Exception("The third term of an event name cannot be a composed name.");

            if (name.GetNTerm(4).IsComposed)
                throw new Exception("The fifth term of an event name cannot be a composed name.");
        }
开发者ID:GAIPS-INESC-ID,项目名称:FAtiMA-Toolkit,代码行数:20,代码来源:AM.cs

示例3: ExtractPropertyFromToM

        private Name ExtractPropertyFromToM(Name property, List<Name> ToMList, string argumentName)
        {
            if (property.GetFirstTerm() != TOM_NAME)
                return property;

            if (property.NumberOfTerms != 3)
                throw new ArgumentException("The property name contains a invalid Theory of the Mind");

            var pers = property.GetNTerm(1);
            var prop = property.GetNTerm(2);

            AssetToMList(ToMList,pers,argumentName);
            return ExtractPropertyFromToM(prop, ToMList, argumentName);
        }
开发者ID:GAIPS-INESC-ID,项目名称:FAtiMA-Toolkit,代码行数:14,代码来源:KB.cs

示例4: Key2ToMList

 private static IEnumerable<Name> Key2ToMList(Name key)
 {
     while (key.IsComposed)
     {
         var c = key.GetFirstTerm();
         yield return c;
         key = key.GetNTerm(1);
     }
     yield return key;
 }
开发者ID:GAIPS-INESC-ID,项目名称:FAtiMA-Toolkit,代码行数:10,代码来源:KB.cs

示例5: IsActionEvent

 public static bool IsActionEvent(Name eventName)
 {
     var t = eventName.GetNTerm(1);
     return t == Constants.ACTION_START_EVENT || t == Constants.ACTION_FINISHED_EVENT;
 }
开发者ID:GAIPS-INESC-ID,项目名称:FAtiMA-Toolkit,代码行数:5,代码来源:ActionEvent.cs

示例6: ActionEvent

 public ActionEvent(uint id, Name eventName, ulong timestamp)
     : base(id, eventName, timestamp)
 {
     Action = eventName.GetNTerm(3);
     Target = eventName.GetNTerm(4);
 }
开发者ID:GAIPS-INESC-ID,项目名称:FAtiMA-Toolkit,代码行数:6,代码来源:ActionEvent.cs

示例7: IsPropertyChangeEvent

 public static bool IsPropertyChangeEvent(Name eventName)
 {
     return eventName.GetNTerm(1) == Constants.PROPERTY_CHANGE_EVENT;
 }
开发者ID:GAIPS-INESC-ID,项目名称:FAtiMA-Toolkit,代码行数:4,代码来源:PropertyChangeEvent.cs

示例8: PropertyChangeEvent

 public PropertyChangeEvent(uint id, Name eventName, ulong timestamp)
     : base(id, eventName, timestamp)
 {
     Property = eventName.GetNTerm(3);
     NewValue = eventName.GetNTerm(4);
 }
开发者ID:GAIPS-INESC-ID,项目名称:FAtiMA-Toolkit,代码行数:6,代码来源:PropertyChangeEvent.cs


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