protected void PrintEdgeText(Sbr.TreeNode node, Sbr.TreeNode parent, EdgeAttributeMap attr) { string sign = parent.Children[0].Value < parent.Children[1].Value ? ">" : "<"; string color = sign == ">" ? "RED" : "GREEN"; PrintEdgeText(node, attr, sign, color); }
private void PrintChangedValue(Sbr.TreeNode node, NodeAttributeMap attr, double eqValue) { double delta = (-node.Value) - eqValue; string color = delta >= 0 ? "#006600" : "#BB0000"; attr.label = String.Format("< <FONT POINT-SIZE=\"10\" FACE=\"ARIAL\">id:{0}<BR/>v:{1:0.0000}<BR/><FONT COLOR=\"{2}\" >Δ:{3:0.0000}</FONT></FONT> >", node.Id, -node.Value, color, delta); }
protected override bool OnNodeBeginFunc(Sbr.TreeNode tree, Sbr.TreeNode node, List <Context> stack, int depth) { bool result = base.OnNodeBeginFunc(tree, node, stack, depth); if (node.Id == 14 || node.Id == 15 || node.Id == 19 || node.Id == 20) { return(false); } return(result); }
protected override void CustomizeEdgeAttributes(Sbr.TreeNode tree, Sbr.TreeNode node, Sbr.TreeNode parent, List <Context> stack, int depth, ai.lib.algorithms.tree.VisTree <Sbr.TreeNode, Sbr.TreeNode, int, Context> .EdgeAttributeMap attr) { base.CustomizeEdgeAttributes(tree, node, parent, stack, depth, attr); if (node.Id == 3) { PrintEdgeText(node, parent, attr); } if (node.Id == 23) { PrintEdgeText(node, parent, attr); } }
protected override void CustomizeNodeAttributes(Sbr.TreeNode tree, Sbr.TreeNode node, List <Context> stack, int depth, ai.lib.algorithms.tree.VisTree <Sbr.TreeNode, Sbr.TreeNode, int, Context> .NodeAttributeMap attr) { base.CustomizeNodeAttributes(tree, node, stack, depth, attr); if (!node.Action.HasPlayerActed(1)) { attr.label = string.Format("id:{0}", node.Id); } else if (node.Id == 18 || node.Id == 19) { attr.penwidth = 3; } }
protected override void CustomizeNodeAttributes(Sbr.TreeNode tree, Sbr.TreeNode node, List <Context> stack, int depth, ai.lib.algorithms.tree.VisTree <Sbr.TreeNode, Sbr.TreeNode, int, Context> .NodeAttributeMap attr) { base.CustomizeNodeAttributes(tree, node, stack, depth, attr); //attr.Map["labeldistance"] = "30"; if (node.Id == 12) { attr.label += string.Format("\\np1 can't have Q \\n=> hide rest ", node.Id); } else if (node.Id == 9 || node.Id == 10 || node.Id == 29 || node.Id == 30) { attr.penwidth = 3; } if (node.Id == 13 || node.Id == 18) { attr.style = "invis"; } }
protected override void CustomizeEdgeAttributes(Sbr.TreeNode tree, Sbr.TreeNode node, Sbr.TreeNode parent, List <Context> stack, int depth, ai.lib.algorithms.tree.VisTree <Sbr.TreeNode, Sbr.TreeNode, int, Context> .EdgeAttributeMap attr) { base.CustomizeEdgeAttributes(tree, node, parent, stack, depth, attr); if (!string.IsNullOrEmpty(attr.label)) { attr.label = attr.label + " "; } if (node.Id == 3 || node.Id == 23) { PrintEdgeText(node, attr, "=", "GREEN"); } if (node.Id == 8 || node.Id == 28) { PrintEdgeText(node, attr, " ", "GREEN"); } if (node.Id == 13 || node.Id == 18) { attr.style = "invis"; } }
protected override void CustomizeNodeAttributes(Sbr.TreeNode tree, Sbr.TreeNode node, List <Sbr.Visualizer.Context> stack, int depth, ai.lib.algorithms.tree.VisTree <Sbr.TreeNode, Sbr.TreeNode, int, Sbr.Visualizer.Context> .NodeAttributeMap attr) { base.CustomizeNodeAttributes(tree, node, stack, depth, attr); if (node.Id == 0) { PrintChangedValue(node, attr, 0.0556); } if (node.Id == 1 || node.Id == 2 || node.Id == 8) { PrintChangedValue(node, attr, 0.3333); } if (node.Id == 9) { PrintChangedValue(node, attr, -0.1111); } if (node.Id == 10) { PrintChangedValue(node, attr, .4444); } if (node.Id == 21 || node.Id == 22 || node.Id == 28) { PrintChangedValue(node, attr, -0.3889); } if (node.Id == 29) { PrintChangedValue(node, attr, -0.2778); } if (node.Id == 30) { PrintChangedValue(node, attr, -0.1111); } if (node.Id == 9 || node.Id == 10 || node.Id == 29 || node.Id == 30) { attr.penwidth = 4; } }
protected void PrintEdgeText(Sbr.TreeNode node, EdgeAttributeMap attr, string sign, string color) { attr.label = String.Format("<{0} <BR/> <FONT FACE = \"ARIAL\" COLOR=\"{2}\" POINT-SIZE=\"40\">{1}</FONT>>", node.Action, sign, color); }
protected override void CustomizeNodeAttributes(Sbr.TreeNode tree, Sbr.TreeNode node, List <Context> stack, int depth, ai.lib.algorithms.tree.VisTree <Sbr.TreeNode, Sbr.TreeNode, int, Context> .NodeAttributeMap attr) { base.CustomizeNodeAttributes(tree, node, stack, depth, attr); }
protected override bool OnNodeBeginFunc(Sbr.TreeNode tree, Sbr.TreeNode node, List <Context> stack, int depth) { bool result = base.OnNodeBeginFunc(tree, node, stack, depth); return(result); }