00001 /*************************************************************************** 00002 * Copyright (C) 2007 by Robot Group Leipzig * 00003 * martius@informatik.uni-leipzig.de * 00004 * fhesse@informatik.uni-leipzig.de * 00005 * der@informatik.uni-leipzig.de * 00006 * * 00007 * This program is free software; you can redistribute it and/or modify * 00008 * it under the terms of the GNU General Public License as published by * 00009 * the Free Software Foundation; either version 2 of the License, or * 00010 * (at your option) any later version. * 00011 * * 00012 * This program is distributed in the hope that it will be useful, * 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00015 * GNU General Public License for more details. * 00016 * * 00017 * You should have received a copy of the GNU General Public License * 00018 * along with this program; if not, write to the * 00019 * Free Software Foundation, Inc., * 00020 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00021 * * 00022 * $Log: wiringsequence.h,v $ 00023 * Revision 1.3 2008/04/28 11:14:54 guettler 00024 * removed include "abstractrobot.h" (not needed) 00025 * 00026 * Revision 1.2 2008/04/17 14:54:45 martius 00027 * randomGen added, which is a random generator with long period and an 00028 * internal state. Each Agent has an instance and passed it to the controller 00029 * and the wiring. This is good for 00030 * a) repeatability on agent basis, 00031 * b) parallel execution as done in ode_robots 00032 * 00033 * Revision 1.1 2007/11/29 19:18:33 martius 00034 * sequence of wirings 00035 * 00036 * Revision 1.1 2007/11/28 10:30:56 martius 00037 * wiring with feedback connections 00038 * 00039 * * 00040 * * 00041 ***************************************************************************/ 00042 #ifndef __WIRINGSEQUENCE_H 00043 #define __WIRINGSEQUENCE_H 00044 00045 #include "abstractwiring.h" 00046 #include <vector> 00047 00048 /** Implements a sequence of wirings 00049 */ 00050 class WiringSequence :public AbstractWiring{ 00051 public: 00052 00053 /** constructor: The wirings given in the list 00054 are applied in the sequence. For the sensors in normal order and 00055 for the motors in reverse order*/ 00056 WiringSequence(std::list<AbstractWiring*>); 00057 /** constructor provided for convinience, essentially calls addWiring(w1);addWiring(w2) 00058 */ 00059 WiringSequence(AbstractWiring* w1, AbstractWiring* w2); 00060 00061 virtual ~WiringSequence(); 00062 00063 virtual bool init(int robotsensornumber, int robotmotornumber, RandGen* randGen=0); 00064 00065 virtual bool wireSensors(const sensor* rsensors, int rsensornumber, 00066 sensor* csensors, int csensornumber, 00067 double noise); 00068 00069 virtual bool wireMotors(motor* rmotors, int rmotornumber, 00070 const motor* cmotors, int cmotornumber); 00071 00072 /** adds a wiring to the list of wirings*/ 00073 virtual void addWiring(AbstractWiring* wiring); 00074 00075 protected: 00076 std::vector<AbstractWiring*> wirings; 00077 bool initialised; 00078 00079 }; 00080 00081 #endif