Esempio n. 1
0
        public void Destroy()
        {
            foreach (CompleteChallengeTree child in children)
            {
                child.Destroy();
            }

            children = null;
            parent   = null;
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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));
                }
            }
        }
Esempio n. 4
0
        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);
        }