public ControlBiological()
        {
            InitializeComponent();

            maturityAge = new ControlStochasticAge();
            maturityAge.stochasticParameterLabel = "Maturity";
            maturityAge.isMultiFleet             = false;
            maturityAge.Dock = DockStyle.Fill;

            tabMaturity.Controls.Add(maturityAge);
            defaultCellValue = 0;
        }
        public ControlBiological(string[] obsYears)
        {
            InitializeComponent();

            maturityAge = new ControlStochasticAge
            {
                StochasticParameterLabel = "Maturity",
                IsMultiFleet             = false,
                Dock = DockStyle.Fill
            };

            TSpawnPanel = new ControlTSpawnPanel()
            {
                SeqYears = obsYears
            };

            tabMaturity.Controls.Add(maturityAge);
            tabTSpawn.Controls.Add(TSpawnPanel);
        }
示例#3
0
        /// <summary>
        /// Initiates the Control's "Startup State" or the "Uninitialized Model" phase.
        /// </summary>
        protected void SetupStartupState()
        {
            //AGEPRO Input Data, If any
            inputData = new AgeproInputFile();

            //Load User Controls
            controlGeneralOptions     = new ControlGeneral();
            controlMiscOptions        = new ControlMiscOptions();
            controlBootstrap          = new ControlBootstrap();
            controlFisherySelectivity = new ControlStochasticAge();
            controlDiscardFraction    = new ControlStochasticAge();
            controlNaturalMortality   = new ControlStochasticAge();
            controlBiological         = new ControlBiological(new string[] { string.Empty });
            controlJan1Weight         = new ControlStochasticWeightAge(new int[] { 0, 1 });
            controlSSBWeight          = new ControlStochasticWeightAge(new int[] { 0, 1, -1 });
            controlMidYearWeight      = new ControlStochasticWeightAge(new int[] { 0, 1, -1, -2 });
            controlCatchWeight        = new ControlStochasticWeightAge(new int[] { 0, 1, -1, -2, -3 });
            controlDiscardWeight      = new ControlStochasticWeightAge(new int[] { 0, 1, -1, -2, -3, -4 });
            controlRecruitment        = new ControlRecruitment();
            controlHarvestScenario    = new ControlHarvestScenario();

            //Set General Options Controls (to handle "New Cases")
            controlGeneralOptions.GeneralInputFile = "";
            controlGeneralOptions.GeneralModelId   = "untitled";
            inputData.General.InputFile            = "";
            inputData.CaseID = controlGeneralOptions.GeneralModelId;

            //initially set Number of Ages
            _ = controlGeneralOptions.GeneralFirstAgeClass; //Spinbox Value

            //Biological Stochastic Options
            controlFisherySelectivity.StochasticParameterLabel = "Fishery Selectivity";
            controlFisherySelectivity.IsMultiFleet             = true;
            controlFisherySelectivity.FleetDependency          = StochasticAgeFleetDependency.dependent;
            controlDiscardFraction.StochasticParameterLabel    = "Discard Fraction";
            controlDiscardFraction.IsMultiFleet              = true;
            controlDiscardFraction.FleetDependency           = StochasticAgeFleetDependency.dependent;
            controlNaturalMortality.StochasticParameterLabel = "Natural Mortality";
            controlNaturalMortality.IsMultiFleet             = false;
            controlNaturalMortality.FleetDependency          = StochasticAgeFleetDependency.independent;

            //Weight Age Options
            controlJan1Weight.IsMultiFleet       = false;
            controlJan1Weight.FleetDependency    = StochasticAgeFleetDependency.independent;
            controlSSBWeight.IsMultiFleet        = false;
            controlSSBWeight.FleetDependency     = StochasticAgeFleetDependency.independent;
            controlMidYearWeight.IsMultiFleet    = false;
            controlMidYearWeight.FleetDependency = StochasticAgeFleetDependency.independent;
            controlCatchWeight.IsMultiFleet      = true;
            controlCatchWeight.FleetDependency   = StochasticAgeFleetDependency.dependent;
            controlDiscardWeight.IsMultiFleet    = true;
            controlDiscardWeight.FleetDependency = StochasticAgeFleetDependency.dependent;

            //Set WeightAgeType
            controlJan1Weight.WeightAgeType    = StochasticWeightOfAge.Jan1Weight;
            controlSSBWeight.WeightAgeType     = StochasticWeightOfAge.SSBWeight;
            controlMidYearWeight.WeightAgeType = StochasticWeightOfAge.MidYearWeight;
            controlCatchWeight.WeightAgeType   = StochasticWeightOfAge.CatchWeight;
            controlDiscardWeight.WeightAgeType = StochasticWeightOfAge.DiscardWeight;

            //Weights Option
            controlJan1Weight.ShowJan1WeightsOption    = false;
            controlJan1Weight.ShowSSBWeightsOption     = false;
            controlJan1Weight.showMidYearWeightsOption = false;
            controlJan1Weight.ShowCatchWeightsOption   = false;
            //SSB
            controlSSBWeight.ShowSSBWeightsOption     = false;
            controlSSBWeight.showMidYearWeightsOption = false;
            controlSSBWeight.ShowCatchWeightsOption   = false;
            //Mid-Year
            controlMidYearWeight.showMidYearWeightsOption = false;
            controlMidYearWeight.ShowCatchWeightsOption   = false;
            //Catch-weight
            controlCatchWeight.ShowCatchWeightsOption = false;
        }