\subsubsection{Battery}
\label{battery}


A \battery is specified by the following 
definitions :\\

(1) It is an hardware component storing energy.\\ 

(2) A battery is connected to a  \processor and each task from this 
processor may or may not specify an energy comsumption rate. \\ 



\begin{center}
Standard attributes
\end{center}

$Name$ : it is the unique name of the \battery.\\

$Cpu_{-}name$: It is the name of \processor which is connected to the \battery.\\

$Capacity$ :   stores  the maximum amount of energy that can be stored at any.
If $Capacity$ is equal to zero than the capacity is not bounded, i.e. infinity capacity.\\

$Rechargeable_{-}Power$ : Models that amount of energy the
 battery is able to store/recover at each unit of time. \\ 
  
$E_{-}max$ : It is the maximum units of energy consumed during one unit
 time-slot when a task is run. \\
 
$E_{-}min$ : It is the minimum units of energy consumed during one unit
 time-slot when a task is run. \\

$Initial_{-}Energy$ : Stores  the current amount of energy stored by a battery at 
start time (i.e. scheduling start time). \\




\begin{center}
Legality rules
\end{center}

(L1) The \battery name must not be empty.\\

(L2) The \battery name must be valid identifier.\\

(L3) An \battery must be connected to a \processor.\\

(L4) Several \battery may  be connected to a given \processor.\\

(L5) The $Capacity$  must be greater or equal to  0.\\

(L6) The $Rechargeable_{-}Power$  must be greater than  0.\\

(L7) The $E_{-}max$  must be greater or equal to 0.\\

(L8) The $Initial_{-}Energy$ must be or equal to 0.\\
 
(L9) The $E_{-}min$  must be greater or equal to 0.\\
 


\begin{center}
Annexes
\end{center}


\begin{center}
Implementation
\end{center}

The figure \ref{dtd_battery} gives the DTD of entity \battery.



\begin{figure}{}
\begin{lstlisting}{}
<!ELEMENT batteries (battery)+>
<!ELEMENT battery (object_type | name 
  | cpu_name | capacity | rechargeable_power 
  | initial_energy | e_max | e_min)*>
<!ATTLIST battery id ID #REQUIRED>
\end{lstlisting}
	\caption{The DTD of entity $Battery$}
	\label{dtd_addr}
\end{figure}



\begin{center}
Example
\end{center}

The figure \ref{example_adr} gives an example of \battery.

This \battery, named $B1$ is based on \processor $processor1$. 
The others parameters must be greater than $0$.

\begin{figure}[H]{}
\begin{lstlisting}{}

 <battery id="100">
   <object_type>BATTERY_OBJECT_TYPE</object_type>
   <name>B1</name>
   <capacity>4</capacity>
   <rechargeable_power>2</rechargeable_power>
   <cpu_name>processor1</cpu_name>
   <e_max>3</e_max>
   <e_min>1</e_min>
   <initial_energy>4</initial_energy>
  </battery>

\end{lstlisting}
\caption{An Example of entity \battery described using Cheddar ADL}
\label{example_adr}
\end{figure}

