/// <summary> /// Defines a coarse partitioning that categorizes nodes based on the degree of the node. /// </summary> private int InitializeColoring() { ColorAssignment.Clear(); ColorSets.Clear(); foreach (var node in _graph.Nodes) { int color = node.OutDegree; ColorAssignment[node] = color; } int nextColor = ColorAssignment.Values.Max() + 1; for (int i = 0; i < D.Count; i++) { ColorAssignment[D[i]] = nextColor; ColorAssignment[I[i]] = nextColor; nextColor++; } foreach (var entry in ColorAssignment) { if (!ColorSets.TryGetValue(entry.Value, out var set)) { ColorSets[entry.Value] = set = new HashSet <Node>(); } set.Add(entry.Key); } return(nextColor); }
public void OnEnable() { for (int x = 0; x < size.x; x++) { for (int y = 0; y < size.y; y++) //Drawable grid { if (cci != null) { cci[x, y].ChangeColor(); } if (grid != null) { grid[x, y].c = Color.clear; } } } if (App.Instance.currentGame.state == App.Game.State.art) { assignment = new ColorAssignment(""); button.text = "Next"; DisplayAssignment(); } else { assignmentText.text = ""; button.text = "Release"; } success = inAll = 0; }
private void DisplayAssignment() { assignment = new ColorAssignment(""); assignmentText.text = "Draw " + assignment.val + " " + assignment.name + " pixels"; }
public ColorAssignmentView(ColorAssignment assignment) { this.assignment = assignment; }