Class Opt4JTask

    • Field Detail

      • injector

        protected com.google.inject.Injector injector
      • parentInjector

        protected com.google.inject.Injector parentInjector
      • closeOnStop

        protected final boolean closeOnStop
      • isClosed

        protected boolean isClosed
    • Constructor Detail

      • Opt4JTask

        @Inject
        public Opt4JTask()
        Constructs a Opt4JTask.
      • Opt4JTask

        public Opt4JTask​(boolean closeOnStop)
        Constructs a Opt4JTask.
        Parameters:
        closeOnStop - close automatically after optimization
    • Method Detail

      • execute

        public void execute()
                     throws java.lang.Exception
        Description copied from class: Task
        Executes the Task.
        Specified by:
        execute in class Task
        Throws:
        java.lang.Exception
      • init

        public void init​(java.util.Collection<com.google.inject.Module> modules)
        Adds a provider for this Opt4JTask. Always present.
        Overrides:
        init in class Task
        Parameters:
        modules - collection of modules to inject into this task.
      • init

        public void init​(com.google.inject.Injector injector)
        Initialize with a parent Injector.
        Parameters:
        injector - the parent injector
      • close

        public void close()
        Close the task.
      • open

        public void open()
        Initialize a task manually before executing it. This enables to get instances of classes before the optimization starts.
      • getIteration

        public int getIteration()
        Returns the current iteration.
        Returns:
        the current iteration
      • getInstance

        public <O> O getInstance​(java.lang.Class<O> type)
        Returns the instance of the given class.
        Type Parameters:
        O - the type of class
        Parameters:
        type - the class
        Returns:
        the instance of the class
      • getInjector

        protected com.google.inject.Injector getInjector()
        Returns the Injector of the task.
        Returns:
        the injector
      • getOptimizer

        protected Optimizer getOptimizer()
        Returns the Optimizer of the task.
        Returns:
        the optimizer