#region License Information /* HeuristicLab * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using System.Collections.Generic; using HeuristicLab.Core; using HeuristicLab.Common; namespace HeuristicLab.Hive { public interface IJob : INamedItem { TimeSpan ExecutionTime { get; } ExecutionState ExecutionState { get; } /// /// indicates wether it is possible to create childjobs from this job /// bool IsParallelizable { get; } /// /// Configuration to indicate if this job should create child-jobs which will be executed in hive /// Cannot be set true if IsParallelizable is false /// bool ComputeInParallel { get; set; } event EventHandler ComputeInParallelChanged; void Run(); void Prepare(); void Start(); void Stop(); void Resume(IEnumerable childJobs); event EventHandler JobStopped; event EventHandler JobFailed; /// /// When this event occurs the job wants to sleep until all his child jobs are finished /// event EventHandler WaitForChildJobs; /// /// This event will be fired when the job wants to have a child-job to be computed /// event EventHandler> NewChildJob; /// /// Will be fired when job wants all child-jobs to be deleted from hive /// event EventHandler DeleteChildJobs; /// /// If this is set to true, the job should be Resumed with the child-jobs attatched instead of Started /// bool CollectChildJobs { get; set; } } }