本文整理汇总了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
}
示例2: SupportsPort
public override bool SupportsPort(Port port)
{
if(port == null)
throw new ArgumentNullException("port");
return port.BusCount == 0 && port.InputSignalCount == port.OutputSignalCount+1;
}
示例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);
}
示例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;
}
示例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);
}
示例6: EnterPort
public override bool EnterPort(Port port, Signal parent, bool again, bool root)
{
if(again)
return false;
_ports.Add(port);
return true;
}
示例7: EnterSignal
public override bool EnterSignal(Signal signal, Port parent, bool again, bool root)
{
if(again)
return false;
_signals.Add(signal);
return true;
}
示例8: FulfillsCondition
public override bool FulfillsCondition(Signal output, Port port)
{
foreach(Condition c in _conditions)
if(!c.FulfillsCondition(output, port))
return false;
return true;
}
示例9: FulfillsCondition
public override bool FulfillsCondition(Signal output, Port port)
{
if(port == null)
return false;
return port.HasArchitectureLink && _match(port.CurrentArchitecture);
}
示例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--; }
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}