00001 /************************************************************************* 00002 This file is part of MESH. 00003 00004 MESH is free software: you can redistribute it and/or modify 00005 it under the terms of the GNU General Public License as published by 00006 the Free Software Foundation, either version 3 of the License, or 00007 (at your option) any later version. 00008 00009 MESH is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with MESH. If not, see <http://www.gnu.org/licenses/>. 00016 **************************************************************************/ 00017 00018 #ifndef MESH_ENERGY_TYPES_H 00019 #define MESH_ENERGY_TYPES_H 00020 00021 #include <glib.h> 00022 #include <mesh.h> 00023 00024 struct mesh_energy_t; 00025 struct mesh_energy_state_t; 00026 struct mesh_time_energy_pair_t; 00027 typedef struct mesh_energy_t mesh_energy; 00028 typedef struct mesh_energy_state_t mesh_energy_state; 00029 typedef struct mesh_time_energy_pair_t mesh_time_energy_pair; 00030 typedef GSList mesh_energy_state_list; 00031 typedef GSList mesh_energy_state_utilization_list; 00032 typedef GArray mesh_energy_feature_array; 00033 00034 struct mesh_energy_t { 00035 gint n_energy_states; // number of energy states 00036 mesh_feature_list *cfl; // list of features for this energy structure 00037 mesh_energy_state_list *cesl; // energy state list 00038 mesh_energy_state *cces; // current energy state 00039 mesh_energy_state *ctes; // target energy state--used to force transitions 00040 mesh_energy_state_utilization_list *cesul; // utilization list 00041 mesh_time last_update; // time of last energy state utilization update 00042 }; 00043 00044 struct mesh_energy_state_t { 00045 gint index; // index of this energy state in the energy state list 00046 gchar *name; // name of energy state 00047 00048 mesh_energy_feature_array *cefa; // array of doubles, representing the comp of each feature in the global feature list 00049 00050 double power; // default energy/time for this energy state 00051 double comp; // default fraction of available computational power available in this state 00052 }; 00053 00054 struct mesh_time_energy_pair_t { 00055 mesh_time time; 00056 double energy; 00057 }; 00058 00059 #endif
1.7.1