Exemplo n.º 1
0
    def run(cls, database=DEFAULT_DB_ALIAS, **kwargs):
        import frepple

        # Determine log level
        loglevel = int(Parameter.getValue('plan.loglevel', database, 0))
        if cls.task and cls.task.user:
            maxloglevel = cls.task.user.getMaxLoglevel(database)
            if loglevel > maxloglevel:
                loglevel = maxloglevel

        # Propagate the operationplan status
        frepple.solver_propagateStatus(loglevel=loglevel).solve()

        # Update the feasibility flag of all operationplans
        for oper in frepple.operations():
            for opplan in oper.operationplans:
                opplan.updateFeasible()

        # Report the result
        print("Initial problems:")
        probs = {}
        for i in frepple.problems():
            if i.name in probs:
                probs[i.name] += 1
            else:
                probs[i.name] = 1
        for i in sorted(probs.keys()):
            print("     %s: %s" % (i, probs[i]))
Exemplo n.º 2
0
    def run(cls, database=DEFAULT_DB_ALIAS, **kwargs):
        import frepple

        # Determine log level
        loglevel = int(Parameter.getValue("plan.loglevel", database, 0))

        # Propagate the operationplan status
        logger.info("Propagating work-in-progress status information")
        frepple.solver_propagateStatus(loglevel=loglevel).solve()

        # Update the feasibility flag of all operationplans
        for oper in frepple.operations():
            for opplan in oper.operationplans:
                opplan.updateFeasible()

        # Report the result
        print("Initial problems:")
        probs = {}
        for i in frepple.problems():
            if i.name in probs:
                probs[i.name] += 1
            else:
                probs[i.name] = 1
        for i in sorted(probs.keys()):
            print("     %s: %s" % (i, probs[i]))
Exemplo n.º 3
0
  def run(cls, database=DEFAULT_DB_ALIAS, **kwargs):
    import frepple

    # Determine log level
    loglevel = int(Parameter.getValue('plan.loglevel', database, 0))
    if cls.task and cls.task.user:
      maxloglevel = cls.task.user.getMaxLoglevel(database)
      if loglevel > maxloglevel:
        loglevel = maxloglevel

    # Propagate the operationplan status
    frepple.solver_propagateStatus(
      loglevel=loglevel
      ).solve()

    # Update the feasibility flag of all operationplans
    for oper in frepple.operations():
      for opplan in oper.operationplans:
        opplan.updateFeasible()

    # Report the result
    print ("Initial problems:")
    probs = {}
    for i in frepple.problems():
      if i.name in probs:
        probs[i.name] += 1
      else:
        probs[i.name] = 1
    for i in sorted(probs.keys()):
      print("     %s: %s" % (i, probs[i]))