Beispiel #1
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            TestFitPackage tf = null;

            DA.GetData(0, ref tf);

            bool active = false;

            DA.GetData(1, ref active);

            if (!active)
            {
                return;
            }

            //Parse FloorPlanPackage for main working area(s).
            List <Brep> baseFloorRegions = Identify.FloorPlateRegions(tf);

            //Categorize circulation segments into "main" and "option" types.
            CirculationPackage circ = Identify.CirculationTypes(tf);

            //Sanitization: generate and remove all obstacles from workable space. (Circulation, Structure, etc.)
            List <Brep> validFloorRegions = Identify.AvailableFloorSpace(baseFloorRegions, tf, circ);

            //First-pass subdivision: coarse division based on proximity and proportion.
            List <Brep> optimizedFloorRegions = Identify.OptimalFloorSpaceConfiguration(validFloorRegions, tf);

            //Parse ProgramPackage(s) and format information/relationships into manifest.
            ProgramManifest pm = Identify.ProgramManifest(tf);

            //Assign program targets to each zone, based on priority + affinity, and subdivide to rooms.
            ZoneManifest zm = Identify.ZoneManifest(optimizedFloorRegions, pm, tf);

            //Populate zones and solve test fit.
            Terrain.Solution(zm, pm);

            List <string> debugText = new List <string>();

            foreach (ZonePackage zone in zm.Zones)
            {
                string output = null;

                foreach (int target in zone.ProgramTargets)
                {
                    output = output + target + " ";
                }

                debugText.Add(output);
            }

            DA.SetData(0, pm);
            DA.SetData(1, zm);
            DA.SetDataList(2, debugText);
        }