Ejemplo n.º 1
0
        protected override void InitializeVariables()
        {
            // Sets the input parameters
            AddParameterToInputs(new Double_Input_ParamDef("BowFactor", new DoubleValueRange(.0005, .05))
            {
                Start = 0.025
            });

            // Sets the intermediate variables we will receive from Grasshopper
            IntermediateDefs.Add(new DoubleList_Output_ParamDef("BowLength"));
            IntermediateDefs.Add(new LineList_Output_ParamDef("ArchLines_1", inDefaultRestraint: FeRestraint.YOnlyRestraint));
            IntermediateDefs.Add(new LineList_Output_ParamDef("ArchLines_2", inDefaultRestraint: FeRestraint.YOnlyRestraint));
            IntermediateDefs.Add(new PointList_Output_ParamDef("FixedSupportJoint_1", FeRestraint.PinnedRestraint));
            IntermediateDefs.Add(new PointList_Output_ParamDef("FixedSupportJoint_2", FeRestraint.PinnedRestraint));

            // Sets the output variables
            FinalDefs.Add(new Double_Output_ParamDef("MaximumStrainEnergy",
                                                     inTargetValue: 0d,
                                                     inExpectedScale: new DoubleValueRange(1e-3, 5e-2)
                                                     ));

            // Sets the output variables
            FinalDefs.Add(new Double_Output_ParamDef("AverageStrainEnergy",
                                                     inTargetValue: 0d,
                                                     inExpectedScale: new DoubleValueRange(1e-3, 5e-2)
                                                     ));

            // Sets the output variables
            FinalDefs.Add(new Double_Output_ParamDef("StDevStrainEnergy",
                                                     inTargetValue: 0d,
                                                     inExpectedScale: new DoubleValueRange(1e-3, 5e-2)
                                                     ));
        }
Ejemplo n.º 2
0
        protected override void InitializeVariables()
        {
            // Sets the variables related to this Objective Function
            AddParameterToInputs(new Point_Input_ParamDef("A", new PointValueRange(new Point3d(-100d, -100d, -100d), new Point3d(100d, 100d, 100d))));
            AddParameterToInputs(new Point_Input_ParamDef("B", new PointValueRange(new Point3d(-100d, -100d, -100d), new Point3d(100d, 100d, 100d))));
            AddParameterToInputs(new Point_Input_ParamDef("C", new PointValueRange(new Point3d(-100d, -100d, -100d), new Point3d(100d, 100d, 100d))));

            IntermediateDefs.Add(new LineList_Output_ParamDef("InnerLines"));
            IntermediateDefs.Add(new PointList_Output_ParamDef("InnerPoints"));
            IntermediateDefs.Add(new PointList_Output_ParamDef("InnerCentroid"));

            FinalDefs.Add(new Double_Output_ParamDef("L1 Side Length",
                                                     inTargetValue: 40d, inExpectedScale: new DoubleValueRange(0d, 200d)));
            FinalDefs.Add(new Double_Output_ParamDef("L2 Side Length",
                                                     inTargetValue: 40d, inExpectedScale: new DoubleValueRange(0d, 200d)));
            FinalDefs.Add(new Double_Output_ParamDef("L3 Side Length",
                                                     inTargetValue: 40d, inExpectedScale: new DoubleValueRange(0d, 200d)));

            FinalDefs.Add(new Double_Output_ParamDef("Delta Of Centroid to Origin",
                                                     inTargetValue: 0d,
                                                     inExpectedScale: new DoubleValueRange(0d, 200d)));
            FinalDefs.Add(new Double_Output_ParamDef("Minimum Angle To X",
                                                     inTargetValue: 0d,
                                                     inExpectedScale: new DoubleValueRange(0d, 90d)));

            FinalDefs.Add(new Double_Output_ParamDef("P1 Height",
                                                     inTargetValue: 0d,
                                                     inExpectedScale: new DoubleValueRange(-100d, 100d)));
            FinalDefs.Add(new Double_Output_ParamDef("P2 Height",
                                                     inTargetValue: 0d,
                                                     inExpectedScale: new DoubleValueRange(-100d, 100d)));
            FinalDefs.Add(new Double_Output_ParamDef("P3 Height",
                                                     inTargetValue: 0d,
                                                     inExpectedScale: new DoubleValueRange(-100d, 100d)));
        }