public ForceDirectedLayoutAlgorithm( IVertexAndEdgeListGraph visitedGraph ) : base(visitedGraph) { this.preLayoutAlgorithm = new RandomLayoutAlgorithm(visitedGraph, this.Positions); this.potential = new DirectedForcePotential(this); this.potentials = new VertexPointFDictionary(); }
public ForceDirectedLayoutAlgorithm( IVertexAndEdgeListGraph visitedGraph ) : base(visitedGraph) { this.preLayoutAlgorithm=new RandomLayoutAlgorithm(visitedGraph,this.Positions); this.potential=new DirectedForcePotential(this); this.potentials=new VertexPointFDictionary(); }
public ArrayStruct(Context context, IType baseType, IPotential <bool> loopCondition) { Context = new Context(context); BaseType = baseType; LoopCondition = loopCondition; Items = new List <IStruct>(); }
public ForceDirectedLayoutAlgorithm( IVertexAndEdgeListGraph visitedGraph, IPotential potential, ILayoutAlgorithm preLayoutAlgorithm ) : base(visitedGraph) { this.preLayoutAlgorithm=preLayoutAlgorithm; this.potential=potential; this.potentials=new VertexPointFDictionary(); }
public ForceDirectedLayoutAlgorithm( IVertexAndEdgeListGraph visitedGraph, IPotential potential, ILayoutAlgorithm preLayoutAlgorithm ) : base(visitedGraph) { this.preLayoutAlgorithm = preLayoutAlgorithm; this.potential = potential; this.potentials = new VertexPointFDictionary(); }
public ForceDirectedLayoutAlgorithm(IVertexAndEdgeListGraph visitedGraph, IPotential potential, ILayoutAlgorithm preLayoutAlgorithm) : base(visitedGraph) { this.preLayoutAlgorithm = null; this.potential = null; this.currentIteration = 0; this.maxIteration = 500; this.potentials = new VertexPointFDictionary(); this.maxMovement = 50f; this.heat = 1f; this.heatDecayRate = 0.99f; this.syncRoot = null; this.preLayoutAlgorithm = preLayoutAlgorithm; this.potential = potential; this.potentials = new VertexPointFDictionary(); }
public ForceDirectedLayoutAlgorithm(IVertexAndEdgeListGraph visitedGraph) : base(visitedGraph) { this.preLayoutAlgorithm = null; this.potential = null; this.currentIteration = 0; this.maxIteration = 500; this.potentials = new VertexPointFDictionary(); this.maxMovement = 50f; this.heat = 1f; this.heatDecayRate = 0.99f; this.syncRoot = null; this.preLayoutAlgorithm = new RandomLayoutAlgorithm(visitedGraph, base.Positions); this.potential = new DirectedForcePotential(this); this.potentials = new VertexPointFDictionary(); }
public static UserType ParseType(XElement xmlType, Dictionary <string, IType> scopedTypes) { var typeName = xmlType.Attribute("name"); var type = new UserType(typeName.Value); var subTypes = xmlType.Elements("type"); var attributes = xmlType.Elements("attr"); scopedTypes.Add(type.Name, type); foreach (var subType in subTypes) { var parsed = ParseType(subType, new Dictionary <string, IType>(scopedTypes)); scopedTypes.Add(parsed.Name, parsed); } foreach (var attr in attributes) { var attrName = attr.Attribute("name"); var typeAttr = attr.Attribute("type"); var typeExpr = attr.Element("type"); var offsetExpr = attr.Element("offset"); var sizeExpr = attr.Element("size"); var conditionExpr = attr.Element("if"); var repeatType = attr.Element("repeat"); IPotential <IType> typePotential; if (typeAttr != null || typeExpr != null) { IPotential <string> namePotential = typeAttr != null ? (IPotential <string>) new TrivialPotential <string>(typeAttr.Value) : (IPotential <string>) new Expression <string>(typeExpr.Value); typePotential = new NamedTypePotential(scopedTypes, namePotential); } else { typePotential = new TrivialPotential <IType>(new VoidType(new Expression <long>(sizeExpr.Value))); } if (offsetExpr != null) { var baseType = typePotential; var offsetType = new OffsetType(baseType, new Expression <long>(offsetExpr.Value)); typePotential = new TrivialPotential <IType>(offsetType); } if (conditionExpr != null) { var baseType = typePotential; var conditionalType = new ConditionalType(baseType, new Expression <bool>(conditionExpr.Value)); typePotential = new TrivialPotential <IType>(conditionalType); } if (repeatType != null) { var lengthExpr = attr.Element("repeat-expr"); var untilExpr = attr.Element("repeat-until"); var baseType = typePotential; if (repeatType.Value == "expr") { var arrayType = new DefiniteArrayType(baseType, new Expression <int>(lengthExpr.Value)); typePotential = new TrivialPotential <IType>(arrayType); } else if (repeatType.Value == "until") { var arrayType = new IndefiniteArrayType(baseType, new Expression <bool>(untilExpr.Value)); typePotential = new TrivialPotential <IType>(arrayType); } } type.Attributes.Add(attrName.Value, typePotential); } return(type); }
public ConditionalType(IPotential <IType> baseType, IPotential <bool> condition) { BaseType = baseType; Condition = condition; }
public NamedTypePotential(Dictionary <string, IType> types, IPotential <string> typeName) { Types = new Dictionary <string, IType>(types); TypeName = typeName; }
public VoidType(IPotential <long> length) { Length = length; }
public IndefiniteArrayType(IPotential <IType> baseType, IPotential <bool> condition) : base(baseType) { LoopCondition = condition; }
public OffsetType(IPotential <IType> baseType, IPotential <long> offset) { BaseType = baseType; Offset = offset; }
public ArrayType(IPotential <IType> baseType) { BaseType = baseType; }
public DefiniteArrayType(IPotential <IType> baseType, IPotential <int> length) : base(baseType) { Length = length; }