1 | package de.uka.ipd.sdq.simucomframework.resources; |
2 | |
3 | /** |
4 | * Provides helper methods for {@link SchedulingStrategy}. |
5 | * |
6 | * @author pmerkle |
7 | * |
8 | */ |
9 | public class SchedulingStrategyHelper { |
10 | |
11 | /** |
12 | * Returns whether the passed <code>strategy</code> is intended to be used |
13 | * with EXACT schedulers or ABSTRACT schedulers. |
14 | * |
15 | * @param strategy |
16 | * @return true, if the strategy is for EXACT schedulers; false, if the the |
17 | * strategy is for ABSTRACT schedulers. |
18 | */ |
19 | public static boolean isExactSchedulingStrategy(SchedulingStrategy strategy) { |
20 | switch (strategy) { |
21 | case DELAY: |
22 | case FCFS: |
23 | case PROCESSOR_SHARING: |
24 | case GINPEX_DISK: |
25 | return false; |
26 | case LINUX_2_6_CFS: |
27 | case LINUX_2_6_O1: |
28 | case SPECIAL_LINUXO1: |
29 | case SPECIAL_WINDOWS: |
30 | case WINDOWS_7: |
31 | case WINDOWS_SERVER_2003: |
32 | case WINDOWS_VISTA: |
33 | case WINDOWS_XP: |
34 | return true; |
35 | default: |
36 | throw new IllegalArgumentException( |
37 | "It could not be determinded whether the strategy " |
38 | + strategy.name() + " is EXACT or ABSTRACT."); |
39 | } |
40 | } |
41 | |
42 | } |