+/**************************************************************************/
+/* ---------------------------------------------------------------------- */
+/* Copyright (C) 2006 - 2008 FRESCOR consortium partners: */
+/* */
+/* Universidad de Cantabria, SPAIN */
+/* University of York, UK */
+/* Scuola Superiore Sant'Anna, ITALY */
+/* Kaiserslautern University, GERMANY */
+/* Univ. Politécnica Valencia, SPAIN */
+/* Czech Technical University in Prague, CZECH REPUBLIC */
+/* ENEA SWEDEN */
+/* Thales Communication S.A. FRANCE */
+/* Visual Tools S.A. SPAIN */
+/* Rapita Systems Ltd UK */
+/* Evidence ITALY */
+/* */
+/* See http://www.frescor.org for a link to partners' websites */
+/* */
+/* FRESCOR project (FP6/2005/IST/5-034026) is funded */
+/* in part by the European Union Sixth Framework Programme */
+/* The European Union is not liable of any use that may be */
+/* made of this code. */
+/* */
+/* */
+/* This file is part of FRSH (FRescor ScHeduler) */
+/* */
+/* FRSH is free software; you can redistribute it and/or modify it */
+/* under terms of the GNU General Public License as published by the */
+/* Free Software Foundation; either version 2, or (at your option) any */
+/* later version. FRSH 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 FRSH; see file */
+/* COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, */
+/* Cambridge, MA 02139, USA. */
+/* */
+/* As a special exception, including FRSH header files in a file, */
+/* instantiating FRSH generics or templates, or linking other files */
+/* with FRSH objects to produce an executable application, does not */
+/* by itself cause the resulting executable application to be covered */
+/* by the GNU General Public License. This exception does not */
+/* however invalidate any other reasons why the executable file might be */
+/* covered by the GNU Public License. */
+/**************************************************************************/
+
+/**
+ * @file frm_cluster_tree.c
+ * @author Michal Sojka <sojkam1@fel.cvut.cz>
+ * @date Wed Feb 18 16:14:35 2009
+ *
+ * @brief Resource manager for cluster tree WSN
+ *
+ */
+
+
#include <frm_generic.h>
#include <forb.h>
#include <error.h>
cum_traffic.length = 0;
cum_traffic.p_nodes = NULL;
- fres_sa_scenario_for_each_contract(scenario, c) {
+ fres_sa_scenario_for_each_no_cancel_contract(scenario, c) {
fres_block_cluster_tree_traffic *contract_traffic;
- fres_block_timing_reqs *timing;
+ frsh_rel_time_t deadline;
/* Extract the cumulative traffic through all contracts */
- contract_traffic = fres_contract_get_block(c->contract,
- FRES_BLOCK_CLUSTER_TREE_TRAFFIC);
-
+ contract_traffic = fres_contract_get_cluster_tree_traffic(c->contract);
if(traffic_fill(&contract_traffic->nodes, &cum_traffic) == -1) {
ret = -1;
goto err_free_traffic;
}
/* Find the most restricting deadline */
- timing = fres_contract_get_timing_reqs(c->contract);
- if (timing) {
- fosa_rel_time_t deadline;
- if (timing->d_equals_t) {
- fres_block_basic *basic;
- basic = fres_contract_get_basic(c->contract);
- deadline = basic->period;
- } else {
- deadline = timing->deadline;
- }
+ if (fres_contract_get_deadline(&c->contract, &deadline)) {
if (fosa_rel_time_is_null(min_deadline) ||
fosa_rel_time_smaller(deadline, min_deadline)) {
min_deadline = deadline;