Class CostComputationComponent

    • Method Detail

      • computeCostsOnOrgUnits

        public CostComputationData computeCostsOnOrgUnits​(OrgUnit orgUnit,
                                                          String catalog,
                                                          String lang)
        Call methods to initialize data and compute groups distribution from an orgUnit
        Parameters:
        orgUnit - the orgUnit
        catalog - the catalog
        lang - the lang
        Returns:
        CostData object containing informations about the formation
      • computeCostsOnOrgUnits

        public CostComputationData computeCostsOnOrgUnits​(OrgUnit orgUnit,
                                                          String catalog,
                                                          String lang,
                                                          OverriddenData overriddenData)
        Call methods to initialize data and compute groups distribution from an orgUnit
        Parameters:
        orgUnit - the orgUnit
        catalog - the catalog
        lang - the lang
        overriddenData - overridden data by the user
        Returns:
        CostData object containing informations about the formation
      • computeCostsOnPrograms

        public CostComputationData computeCostsOnPrograms​(List<Program> programs)
        Call methods to initialize data and compute groups distribution from a catalog
        Parameters:
        programs - the catalog
        Returns:
        CostData object containing informations about the formation
      • computeCostsOnPrograms

        public CostComputationData computeCostsOnPrograms​(List<Program> programs,
                                                          OverriddenData overriddenData)
        Call methods to initialize data and compute groups distribution from a catalog
        Parameters:
        programs - the catalog
        overriddenData - overridden data by the user
        Returns:
        CostData object containing informations about the formation
      • computeCostsOnProgram

        public CostComputationData computeCostsOnProgram​(Program program)
        Call methods to initialize data and compute groups distribution from a program
        Parameters:
        program - the program
        Returns:
        CostData object containing informations about the formation
      • computeCostsOnProgram

        public CostComputationData computeCostsOnProgram​(Program program,
                                                         OverriddenData overriddenData)
        Call methods to initialize data and compute groups distribution from a program
        Parameters:
        program - the program
        overriddenData - overridden data by the user
        Returns:
        CostData object containing informations about the formation
      • _populateOrgUnit

        protected void _populateOrgUnit​(CostComputationData costData,
                                        OrgUnit orgUnit,
                                        CostComputationDataCache cache,
                                        String orgUnitPath,
                                        String catalog,
                                        String lang)
        Iterate and explore each program of an orgUnit
        Parameters:
        orgUnit - the orgUnit
        costData - object containing informations about the formation
        cache - the cache values
        orgUnitPath - the current path
        catalog - the catalog
        lang - the lang
      • _populateProgram

        protected void _populateProgram​(CostComputationData costData,
                                        Program program,
                                        String programPath,
                                        CostComputationDataCache cache)
        Iterate and explore each container of the catalog
        Parameters:
        program - the catalog
        costData - object containing informations about the formation
        programPath - the current path
        cache - the cache values
      • _populateStep

        protected void _populateStep​(CostComputationData costData,
                                     ProgramItem programItem,
                                     String objectPath,
                                     CostComputationDataCache cache)
        Iterate recursively each child of the current programItem to find the lowest course level
        Parameters:
        costData - object containing informations about the formation
        objectPath - the current path
        programItem - the current node
        cache - the cache values
      • _populateCourse

        protected void _populateCourse​(CostComputationData costData,
                                       Course course,
                                       String coursePath,
                                       CostComputationDataCache cache)
        Explore the course and iterate its course part to populate them
        Parameters:
        costData - object containing informations about the formation
        coursePath - the current path
        course - the course
        cache - the cache values
      • _populateCoursePart

        protected void _populateCoursePart​(CostComputationData costData,
                                           CoursePart coursePart,
                                           Course courseParent,
                                           String coursePartPath,
                                           CostComputationDataCache cache)
        Fill a costData object with informations about the course and the course part
        Parameters:
        costData - object containing informations about the formation
        coursePart - the object to explore
        courseParent - The parent of the course part
        coursePartPath - the current path
        cache - the cache values
      • _computeEffectiveAndVentilation

        protected void _computeEffectiveAndVentilation​(CostComputationData costData,
                                                       CoursePart coursePart,
                                                       Course courseParent,
                                                       NormDetails normDetails,
                                                       String coursePartPath,
                                                       CostComputationDataCache cache)
        Handle all effectives computations from a course part
        Parameters:
        costData - object containing informations about the formation
        coursePart - the object to explore
        courseParent - the parent of the course part
        normDetails - informations about the norm of the course part
        coursePartPath - the course part path
        cache - the cache values
      • _computeEqTDVentilation

        protected void _computeEqTDVentilation​(CostComputationData costData,
                                               CoursePart coursePart,
                                               Double enteredEffective,
                                               Double globalEffective,
                                               Double eqTDTotal)
        Compute the effective and the eqTD ventilation by step
        Parameters:
        costData - object containing informations about the formation
        coursePart - the object to explore
        enteredEffective - the entered effective of the coursePart
        globalEffective - the global effective of the coursePart
        eqTDTotal - the total eqTD value of the coursePart
      • _getCourseWeight

        protected Double _getCourseWeight​(ProgramItem programItem,
                                          ProgramItem programItemParent,
                                          CostComputationData costData)
        Divide the effective of a program item by the total effective of a course list to retrieve the weight
        Parameters:
        programItem - the program item
        programItemParent - the parent of the program item
        costData - object containing informations about the formation
        Returns:
        the weight of the program item
      • _getStepHolder

        protected Container _getStepHolder​(Course courseHolder,
                                           String coursePartPrefix)
        Get the step holder associated to the course
        Parameters:
        courseHolder - the course holder of a course part
        coursePartPrefix - the current prefix
        Returns:
        the step holder
      • _getNorm

        protected String _getNorm​(CoursePart coursePart,
                                  String coursePartPrefix,
                                  Container stepHolder,
                                  CostComputationDataCache cache)
        Retrieve the value of the norm
        Parameters:
        coursePart - informations about the teaching hours of a course
        coursePartPrefix - the current prefix
        stepHolder - the step holder of the course
        cache - the cache values
        Returns:
        the norm value
      • _computeLocalEffectiveByWeight

        protected void _computeLocalEffectiveByWeight​(CostComputationData costData,
                                                      ProgramItem programItem,
                                                      ProgramItem programItemParent,
                                                      Effectives computedEffective,
                                                      String programItemPath,
                                                      CostComputationDataCache cache)
        Compute the local effective of a programItem
        Parameters:
        costData - object containing informations about the formation
        programItem - the current programItem
        programItemParent - the parent of the programItem
        computedEffective - the computed effective
        programItemPath - the current path
        cache - the values cache
      • _getSteps

        protected Map<String,​Container_getSteps​(CostComputationData costData,
                                                        ProgramItem programItem,
                                                        String programItemPath)
        Get all steps of a program item
        Parameters:
        costData - object containing informations about the formation
        programItem - the current node
        programItemPath - the current path
        Returns:
        all steps of a program item
      • _getWeight

        protected double _getWeight​(ProgramItem programItem)
        Define the weight of an item
        Parameters:
        programItem - the item to evaluate
        Returns:
        the weight
      • _calculEqTD

        protected double _calculEqTD​(double effectif,
                                     double effectifTotal,
                                     double eqTDTotal)
        Compute the TD equivalent
        Parameters:
        effectif - the capacity
        effectifTotal - the total capacity
        eqTDTotal - the total TD equivalent
        Returns:
        the computed TD equivalent
      • _computeEqTDLocal

        protected double _computeEqTDLocal​(double duration,
                                           long groupes,
                                           Double eqTD)
        Compute the total TD equivalent
        Parameters:
        duration - the duration of the TD
        groupes - the group repartition
        eqTD - the TD equivalent
        Returns:
        the computed TD equivalent
      • _computeGroups

        protected long _computeGroups​(double enteredEffective,
                                      double computedEffective,
                                      NormDetails normDetails)
        compute the number of groups needed
        Parameters:
        enteredEffective - the forecast capacity
        computedEffective - the computed capacity
        normDetails - all informations needed to compute the norm
        Returns:
        the number of groups to open
      • _getStepsHolder

        protected Set<Container_getStepsHolder​(ProgramItem programItem,
                                                 String coursePartPrefix)
        Find steps holders
        Parameters:
        programItem - the item we want to explore
        coursePartPrefix - the current prefix
        Returns:
        a list of steps holders
      • _getNorm

        protected String _getNorm​(Content content,
                                  String nature,
                                  String prefix,
                                  boolean isStepholder,
                                  CostComputationDataCache cache)
        Retrieve the norm value of a content
        Parameters:
        content - the content
        nature - the nature of the content
        prefix - the current prefix
        isStepholder - define if the content is a step holder or not
        cache - the cache values
        Returns:
        the norm of the content
      • _getOrgUnits

        protected String _getOrgUnits​(Course courseHolder)
        Retrieve the orgUnit
        Parameters:
        courseHolder - the course
        Returns:
        the orgUnit