Index: branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/Enums/DowntimeType.cs
===================================================================
--- branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/Enums/DowntimeType.cs	(revision 8995)
+++ branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/Enums/DowntimeType.cs	(revision 8995)
@@ -0,0 +1,30 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+
+namespace HeuristicLab.Services.Hive.DataAccess {
+
+  [Serializable]
+  public enum DowntimeType {
+    Offline, Shutdown
+  };
+}
Index: branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj
===================================================================
--- branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj	(revision 8977)
+++ branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj	(revision 8995)
@@ -99,4 +99,5 @@
     <None Include="Plugin.cs.frame" />
     <Compile Include="Enums\Command.cs" />
+    <Compile Include="Enums\DowntimeType.cs" />
     <Compile Include="Enums\CpuArchitecture.cs" />
     <Compile Include="Plugin.cs" />
@@ -156,5 +157,5 @@
   </PropertyGroup>
   <PropertyGroup>
-   <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
 set ProjectDir=$(ProjectDir)
 set SolutionDir=$(SolutionDir)
@@ -162,5 +163,5 @@
 
 call PreBuildEvent.cmd</PreBuildEvent>
-<PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
+    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
 export ProjectDir=$(ProjectDir)
 export SolutionDir=$(SolutionDir)
Index: branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.cs
===================================================================
--- branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.cs	(revision 8977)
+++ branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.cs	(revision 8995)
@@ -1,2 +1,23 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
 using System;
 using System.Data.Linq.Mapping;
Index: branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml
===================================================================
--- branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml	(revision 8977)
+++ branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml	(revision 8995)
@@ -95,4 +95,5 @@
       <Column Name="Recurring" Type="System.Boolean" DbType="Bit" CanBeNull="false" />
       <Column Name="RecurringId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" />
+      <Column Name="DowntimeType" Storage="_Type" Type="global::HeuristicLab.Services.Hive.DataAccess.DowntimeType" DbType="VarChar(MAX)" CanBeNull="false" />
       <Association Name="Resource_Downtime" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" />
     </Type>
Index: branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs
===================================================================
--- branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs	(revision 8977)
+++ branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs	(revision 8995)
@@ -2164,4 +2164,6 @@
 		private System.Guid _RecurringId;
 		
+		private global::HeuristicLab.Services.Hive.DataAccess.DowntimeType _Type;
+		
 		private EntityRef<Resource> _Resource;
 		
@@ -2184,4 +2186,6 @@
     partial void OnRecurringIdChanging(System.Guid value);
     partial void OnRecurringIdChanged();
+    partial void OnDowntimeTypeChanging(global::HeuristicLab.Services.Hive.DataAccess.DowntimeType value);
+    partial void OnDowntimeTypeChanged();
     #endregion
 		
@@ -2332,4 +2336,24 @@
 					this.SendPropertyChanged("RecurringId");
 					this.OnRecurringIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Type", DbType="VarChar(MAX)", CanBeNull=false)]
+		public global::HeuristicLab.Services.Hive.DataAccess.DowntimeType DowntimeType
+		{
+			get
+			{
+				return this._Type;
+			}
+			set
+			{
+				if ((this._Type != value))
+				{
+					this.OnDowntimeTypeChanging(value);
+					this.SendPropertyChanging();
+					this._Type = value;
+					this.SendPropertyChanged("DowntimeType");
+					this.OnDowntimeTypeChanged();
 				}
 			}
Index: branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Initialize Hive Database.sql
===================================================================
--- branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Initialize Hive Database.sql	(revision 8977)
+++ branches/HiveTaskScheduler/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Initialize Hive Database.sql	(revision 8995)
@@ -75,4 +75,5 @@
   [Recurring] Bit NOT NULL,
   [RecurringId] UniqueIdentifier NOT NULL,
+  [DowntimeType] VarChar(MAX) NOT NULL,
   CONSTRAINT [PK_dbo.Downtime] PRIMARY KEY ([DowntimeId])
   )
Index: branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/Convert.cs
===================================================================
--- branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/Convert.cs	(revision 8977)
+++ branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/Convert.cs	(revision 8995)
@@ -118,5 +118,5 @@
     public static DT.Downtime ToDto(DB.Downtime source) {
       if (source == null) return null;
-      return new DT.Downtime { Id = source.DowntimeId, AllDayEvent = source.AllDayEvent, EndDate = source.EndDate, Recurring = source.Recurring, RecurringId = source.RecurringId, ResourceId = source.ResourceId, StartDate = source.StartDate };
+      return new DT.Downtime { Id = source.DowntimeId, AllDayEvent = source.AllDayEvent, EndDate = source.EndDate, Recurring = source.Recurring, RecurringId = source.RecurringId, ResourceId = source.ResourceId, StartDate = source.StartDate, DowntimeType = source.DowntimeType };
     }
     public static DB.Downtime ToEntity(DT.Downtime source) {
@@ -127,5 +127,5 @@
     public static void ToEntity(DT.Downtime source, DB.Downtime target) {
       if ((source != null) && (target != null)) {
-        target.DowntimeId = source.Id; target.AllDayEvent = source.AllDayEvent; target.EndDate = source.EndDate; target.Recurring = source.Recurring; target.RecurringId = source.RecurringId; target.ResourceId = source.ResourceId; target.StartDate = source.StartDate;
+        target.DowntimeId = source.Id; target.AllDayEvent = source.AllDayEvent; target.EndDate = source.EndDate; target.Recurring = source.Recurring; target.RecurringId = source.RecurringId; target.ResourceId = source.ResourceId; target.StartDate = source.StartDate; target.DowntimeType = source.DowntimeType;
       }
     }
Index: branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/DataTransfer/Downtime.cs
===================================================================
--- branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/DataTransfer/Downtime.cs	(revision 8977)
+++ branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/DataTransfer/Downtime.cs	(revision 8995)
@@ -22,4 +22,5 @@
 using System;
 using System.Runtime.Serialization;
+using HeuristicLab.Services.Hive.DataAccess;
 
 namespace HeuristicLab.Services.Hive.DataTransfer {
@@ -38,4 +39,6 @@
     [DataMember]
     public Guid ResourceId { get; set; }
+    [DataMember]
+    public DowntimeType DowntimeType { get; set; }
   }
 }
Index: branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/Manager/HeartbeatManager.cs
===================================================================
--- branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/Manager/HeartbeatManager.cs	(revision 8977)
+++ branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/Manager/HeartbeatManager.cs	(revision 8995)
@@ -50,4 +50,7 @@
         if (heartbeat.HbInterval != slave.HbInterval) {
           actions.Add(new MessageContainer(MessageContainer.MessageType.NewHBInterval));
+        }
+        if (ShutdownSlaveComputer(slave.Id)) {
+          actions.Add(new MessageContainer(MessageContainer.MessageType.ShutdownComputer));
         }
 
@@ -165,5 +168,9 @@
     private bool SlaveIsAllowedToCalculate(Guid slaveId) {
       // the slave may only calculate if there is no downtime right now. this needs to be checked for every parent resource also
-      return dao.GetParentResources(slaveId).All(r => dao.GetDowntimes(x => x.ResourceId == r.Id && (DateTime.Now >= x.StartDate) && (DateTime.Now <= x.EndDate)).Count() == 0);
+      return dao.GetParentResources(slaveId).All(r => dao.GetDowntimes(x => x.ResourceId == r.Id && x.DowntimeType == DA.DowntimeType.Offline && (DateTime.Now >= x.StartDate) && (DateTime.Now <= x.EndDate)).Count() == 0);
+    }
+
+    private bool ShutdownSlaveComputer(Guid slaveId) {
+      return dao.GetParentResources(slaveId).Any(r => dao.GetDowntimes(x => x.ResourceId == r.Id && x.DowntimeType == DA.DowntimeType.Shutdown && (DateTime.Now >= x.StartDate) && (DateTime.Now <= x.EndDate)).Count() != 0);
     }
   }
Index: branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/MessageContainer.cs
===================================================================
--- branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/MessageContainer.cs	(revision 8977)
+++ branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/MessageContainer.cs	(revision 8995)
@@ -48,5 +48,6 @@
       ShutdownSlave,  // slave should shutdown immediately without submitting results
       SayHello,  // Slave should say hello, because job is unknown to the server
-      NewHBInterval,
+      NewHBInterval, // change the polling to a new interval
+      ShutdownComputer, // shutdown the computer the slave runs on
     };
 
Index: branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/Settings.cs
===================================================================
--- branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/Settings.cs	(revision 8977)
+++ branches/HiveTaskScheduler/HeuristicLab.Services.Hive/3.3/Settings.cs	(revision 8995)
@@ -1,3 +1,24 @@
-﻿namespace HeuristicLab.Services.Hive.Properties {
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+namespace HeuristicLab.Services.Hive.Properties {
     
     
