Class CostComputationComponent

java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.odfpilotage.cost.CostComputationComponent
All Implemented Interfaces:
LogEnabled, Component, Serviceable

This component computes values used by the cost modeling tool
  • Field Details

  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager manager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Throws:
      ServiceException
    • 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

      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

      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

      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

      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
    • _setProgramItemStructure

      protected void _setProgramItemStructure(ProgramItem programItem, CostComputationData costData, CostComputationDataCache cache)
      Iterate the program item structure and compute the global effective for each course part
      Parameters:
      programItem - the program item
      costData - object containing informations about the formation
      cache - the cache values
    • _populateOrgUnits

      protected void _populateOrgUnits(CostComputationData costData, OrgUnit orgUnit, CostComputationDataCache cache, String catalog, String lang)
      Iterate and explore each orgUnit of the structure
      Parameters:
      orgUnit - the orgUnit
      costData - object containing informations about the formation
      cache - the cache values
      catalog - the catalog
      lang - the lang
    • _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
    • _populateSubProgram

      protected void _populateSubProgram(CostComputationData costData, Program program, String programPath, CostComputationDataCache cache)
      Iterate and explore each sub program 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 prefix)
      Get the step holder associated to the course
      Parameters:
      courseHolder - the course holder of a course part
      prefix - 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
    • _getNormDetails

      protected Optional<NormDetails> _getNormDetails(Container stepHolder, CoursePart coursePart, String coursePartPrefix, CostComputationDataCache cache)
      Get all informations about the norm
      Parameters:
      stepHolder - the step holder
      coursePart - informations about the teaching hours of a course
      coursePartPrefix - the current prefix
      cache - the cache values
      Returns:
      norm details
    • _getComputedGlobalAndEnteredEffectives

      Get the computed global and entered effectives
      Parameters:
      costData - object containing informations about the formation
      coursePart - the course part
      cache - the cached values
      Returns:
      the computed global and entered effectives
    • _computeGlobalAndEnteredEffectives

      protected Effectives _computeGlobalAndEnteredEffectives(CostComputationData costData, CoursePart coursePart, ProgramItem programItem, Double initialWeight, CostComputationDataCache cache)
      Compute the global and entered effectives
      Parameters:
      costData - object containing informations about the formation
      coursePart - the course part
      programItem - the item we want to evaluate the capacity
      initialWeight - the weight
      cache - the cached values
      Returns:
      the computed effective
    • _getComputedLocalEffective

      protected Effectives _getComputedLocalEffective(CostComputationData costData, CoursePart coursePart, Course courseParent, String coursePartPath, CostComputationDataCache cache)
      Get the computed local effective
      Parameters:
      costData - object containing informations about the formation
      coursePart - the course part
      courseParent - the course parent of the course part
      coursePartPath - the course part path
      cache - the cache values
      Returns:
      the computed effective
    • _computeLocalEffective

      protected Effectives _computeLocalEffective(CostComputationData costData, CoursePart coursePart, ProgramItem programItem, String programItemPath, CostComputationDataCache cache)
      Compute the local effective
      Parameters:
      costData - object containing informations about the formation
      coursePart - the course part
      programItem - the item we want to evaluate the capacity
      programItemPath - the current path
      cache - the cache values
      Returns:
      the computed effective
    • _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 prefix)
      Find steps holders
      Parameters:
      programItem - the item we want to explore
      prefix - 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