public void Destroy() { foreach (CompleteChallengeTree child in children) { child.Destroy(); } children = null; parent = null; }
public static List <Schedule> GetSchedules(int targetUtilization, int maxUtilization, int maxDeadline, int m) { List <Schedule> result = new List <Schedule>(); CompleteChallengeTree root = new CompleteChallengeTree(null, 0, targetUtilization); root.AlternativePaths(maxUtilization, maxDeadline); root.AddSchedules(result, m); root.Destroy(); return(result); }
public CompleteChallengeTree(CompleteChallengeTree parent, int u, int targetUtilization) { this.parent = parent; this.u = u; for (int i = Math.Max(1, u); i <= targetUtilization; i++) { if (this.getU() + i <= targetUtilization) { children.Add(new CompleteChallengeTree(this, i, targetUtilization)); } } }
public CompleteChallengeTree Clone(CompleteChallengeTree parent) { CompleteChallengeTree result = new CompleteChallengeTree(); result.u = this.u; result.c = this.c; result.t = this.t; result.parent = parent; foreach (CompleteChallengeTree child in children) { result.children.Add(child.Clone(result)); } return(result); }