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


C# Core.Port类代码示例

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


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

示例1: DoTraverse

 protected override void DoTraverse(Port rootPort, IScanVisitor visitor, bool ignoreHold)
 {
     List<Guid> signals = new List<Guid>();
     foreach(Signal input in rootPort.InputSignals)
         if(!TraverseSignal(signals, input, rootPort, ignoreHold, visitor))
             break; // finished
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:7,代码来源:AllSignalsStrategy.cs

示例2: SupportsPort

        public override bool SupportsPort(Port port)
        {
            if(port == null)
                throw new ArgumentNullException("port");

            return port.BusCount == 0 && port.InputSignalCount == port.OutputSignalCount+1;
        }
开发者ID:JackWangCUMT,项目名称:mathnet-yttrium,代码行数:7,代码来源:SyncArchitecture.cs

示例3: TraverseSignal

        private bool TraverseSignal(List<Guid> signals, List<Guid> ports, List<Guid> buses, Signal signal, Port target, bool ignoreHold, IScanVisitor visitor)
        {
            if(signal == null)
                return true;

            bool again = true;
            if(!signals.Contains(signal.InstanceId))
            {
                again = false;
                signals.Add(signal.InstanceId);
            }

            if(visitor.EnterSignal(signal, target, again, target == null))
            {
                // LEAF SIGNAL?
                if(!signal.BehavesAsBeingDriven(ignoreHold))
                {
                    if(!visitor.VisitLeaf(signal, again))
                        return false; // finished
                }
                else // HANDLE PORT
                {
                    TraversePort(signals, ports, buses, signal.DrivenByPort, signal, ignoreHold, visitor);
                }
            }
            return visitor.LeaveSignal(signal, target, again, target == null);
        }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:27,代码来源:AllStrategy.cs

示例4: IsMember

        public override ECategoryMembership IsMember(Port port)
        {
            ECategoryMembership childMembership;
            Entity entity = port.Entity;

            if(port.BusCount != 0)
                return ECategoryMembership.NotMember;

            childMembership = EvaluateJointChildMembership(port.InputSignals);
            if(childMembership == ECategoryMembership.NotMember)
                return ECategoryMembership.NotMember;

            if(entity.EqualsById(_additiveEntity))
            {
                if((_structure & EAlgebraicStructure.AdditiveClose) == EAlgebraicStructure.AdditiveClose && childMembership == ECategoryMembership.Member)
                    return ECategoryMembership.Member;
                else //ECategoryMembership.Unknown
                    return ECategoryMembership.Unknown;
            }
            else if(entity.EqualsById(_multiplicativeEntity))
            {
                if((_structure & EAlgebraicStructure.MultiplicativeClose) == EAlgebraicStructure.MultiplicativeClose && childMembership == ECategoryMembership.Member)
                    return ECategoryMembership.Member;
                else //ECategoryMembership.Unknown
                    return ECategoryMembership.Unknown;
            }
            else
                return ECategoryMembership.NotMember;
        }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:29,代码来源:AlgebraicStructureCategory.cs

示例5: DoTraverse

 protected override void DoTraverse(Port rootPort, IScanVisitor visitor, bool ignoreHold)
 {
     List<Guid> signals = new List<Guid>();
     List<Guid> ports = new List<Guid>();
     List<Guid> buses = new List<Guid>();
     TraversePort(signals, ports, buses, rootPort, null, ignoreHold, visitor);
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:7,代码来源:AllSpanningTreeStrategy.cs

示例6: EnterPort

 public override bool EnterPort(Port port, Signal parent, bool again, bool root)
 {
     if(again)
         return false;
     _ports.Add(port);
     return true;
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:7,代码来源:CollectVisitor.cs

示例7: EnterSignal

 public override bool EnterSignal(Signal signal, Port parent, bool again, bool root)
 {
     if(again)
         return false;
     _signals.Add(signal);
     return true;
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:7,代码来源:CollectVisitor.cs

示例8: FulfillsCondition

 public override bool FulfillsCondition(Signal output, Port port)
 {
     foreach(Condition c in _conditions)
         if(!c.FulfillsCondition(output, port))
             return false;
     return true;
 }
开发者ID:JackWangCUMT,项目名称:mathnet-yttrium,代码行数:7,代码来源:AndCondition.cs

示例9: FulfillsCondition

        public override bool FulfillsCondition(Signal output, Port port)
        {
            if(port == null)
                return false;

            return port.HasArchitectureLink && _match(port.CurrentArchitecture);
        }
开发者ID:JackWangCUMT,项目名称:mathnet-yttrium,代码行数:7,代码来源:ArchitectureCondition.cs

示例10: Traverse

 public void Traverse(Port rootPort, IScanVisitor visitor, bool ignoreHold)
 {
     //lock(??) {
     ScanStrategy strat = ProvideExecutableInstance();
     strat._activeScans++; //}
     try { strat.DoTraverse(rootPort, visitor, ignoreHold); }
     finally { strat._activeScans--; }
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:8,代码来源:ScanStrategy.cs

示例11: ReregisterArchitecture

 protected override void ReregisterArchitecture(Port oldPort, Port newPort)
 {
     this.inputSignals = newPort.InputSignals;
     this.outputSignals = newPort.OutputSignals;
     for(int i = 0; i < inputSignals.Count; i++)
         inputSignals[i].ValueChanged += CompoundArchitecture_SignalValueChanged;
     system.PushInputValueRange(inputSignals);
 }
开发者ID:JackWangCUMT,项目名称:mathnet-yttrium,代码行数:8,代码来源:CompoundArchitecture.cs

示例12: VisitLeaf

 public override bool VisitLeaf(Port port, bool again)
 {
     // ## REMOVE PLANS ON UNCERTAIN PORTS WITHOUT CHILDS
     if(_plans[port.InstanceId] == ManipulationPlan.AlterIfChildsAltered
         || _plans[port.InstanceId] == ManipulationPlan.CloneIfChildsAltered)
         _plans[port.InstanceId] = ManipulationPlan.DontAlter;
     return base.VisitLeaf(port, again);
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:8,代码来源:Manipulator.cs

示例13: EnterPort

 public override bool EnterPort(Port port, Signal parent, bool again, bool root)
 {
     // ## DIVE DEEPER ONLY ON UNCERTAIN PORTS
     if(_plans[port.InstanceId] != ManipulationPlan.AlterIfChildsAltered
         && _plans[port.InstanceId] != ManipulationPlan.CloneIfChildsAltered)
         return false;
     return base.EnterPort(port, parent, again, root);
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:8,代码来源:Manipulator.cs

示例14: EnterSignal

 public override bool EnterSignal(Signal signal, Port parent, bool again, bool root)
 {
     if(again)
         return false;
     if(_match(signal))
         return _action(signal);
     return true;
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:8,代码来源:SignalConditionalActionVisitor.cs

示例15: SyncArchitecture

        public SyncArchitecture(Port port)
            : base(_entityId, _entityId, false)
        {
            //System.Diagnostics.Debug.Assert(SupportsPort(port));
            SetPort(port);

            port.InputSignals[port.InputSignalCount-1].SignalValueChanged  += SyncArchitecture_SignalValueChanged;
        }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:8,代码来源:SyncArchitecture.cs


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