/******************************************************* * * DESCRIPTION: Electrical circuit to Bond Graph mapper * * AUTHOR: Mariana C. D'Abreu * * EMAIL: mdabreu@dc.uba.ar * ********************************************************/ #ifndef BGMAPPER_H #define BGMAPPER_H #include #include "bg.h" #include "circuit.h" //--- forward declarations --- class BondGraph; class ECircuit; //****************************************************** // // Class EC_BG_Mapper // // Description: mapeador de circuitos eléctricos a // modelos Bond Graph // //****************************************************** class EC_BG_Mapper { public: EC_BG_Mapper() {}; virtual ~EC_BG_Mapper() {}; virtual BondGraph *mappToBondGraph( const ECircuit & ); protected: virtual bool mappStructures ( const ECircuit &, BondGraph & ); virtual bool insertCeroJunctions ( const ECircuit &, BondGraph & ); virtual bool insertOneJunctions ( const ECircuit &, BondGraph & ); virtual bool deleteGroundPotential ( const ECircuit &, BondGraph & ); virtual bool assignPowerDirections ( const ECircuit &, BondGraph & ); virtual bool assignCausality ( BondGraph & ); virtual bool simplify ( BondGraph & ); virtual bool checkSingularities ( BondGraph & ); private: typedef BondGraph::BGGraph::PNode BGPNode; typedef BondGraph::BGGraph::PEdge BGPEdge; typedef ECircuit::CircuitGraph::PNode ECPNode; typedef ECircuit::CircuitGraph::PEdge ECPEdge; bool copyGraphStructure ( const ECircuit &, BondGraph & ); void reached ( BondGraph &, BGPNode, list & ); void insertOneJunctionsInPortComponent ( BondGraph &, PortComp * ); bool deleteGroundPotentialFromSources ( const ECircuit &, BondGraph & ); bool assignPowerDirectionsFromNode ( BondGraph &, const Id & , bool ); }; #endif