00001
00002
00003
00004
00005
00006
00007
00008 #ifndef COMPONENTPOSITION_H_
00009 #define COMPONENTPOSITION_H_
00010
00011 #include <vector>
00012 #include <set>
00013 #include <map>
00014 #include <list>
00015 #include "float.h"
00016 #include "math.h"
00017 #include "quantities/onchipcommunication/IpGeometry.h"
00018 #include "environment/onchipcommunication/InstallationSite.h"
00019 #include "environment/onchipcommunication/InstallationFace.h"
00020
00021 namespace cosi {
00022
00023 namespace rules {
00024
00025 namespace onchipcommunication {
00026
00027 using namespace cosi::quantity::onchipcommunication;
00028
00029 using namespace cosi::environment::onchipcommunication;
00030
00031 using namespace std ;
00032
00033 class ComponentPosition {
00034 public:
00035 ComponentPosition(std::vector< IpGeometry > Ip, IpGeometry ChipArea, double Density);
00036
00037 virtual ~ComponentPosition();
00038
00039 list< int > Neighbors(int V, int D, double Span);
00040 double Distance( int U , int V ) ;
00041 double GetX(int V) ;
00042 double GetY(int V) ;
00043
00044 int Size() ;
00045
00046 std::vector< InstallationSite > GetInstallationSites() ;
00047
00048 private:
00049
00050 void SetUpCoordinates(std::vector< IpGeometry > Ip, IpGeometry ChipArea) ;
00051 set< pair< double , double > > IntervalsX( double pY ) ;
00052 list< int > LocalSearch( int A , double X , double Y , double D ) ;
00053 double VtoAdist( double X , double Y , int A ) ;
00054 double VtoAdist( int V , int A ) ;
00055 double Distance( double X1 , double Y1 , double X2 , double Y2 ) ;
00056 Position Closest(int A, int V) ;
00057
00058 std::vector< IpGeometry > mIp;
00059 std::vector< InstallationFace > mInstallationFaces;
00060 std::vector< InstallationSite > mInstallationSites;
00061 std::vector< InstallationSite > mCandidateCenters;
00062 std::vector< int > mCentersId;
00063
00064 std::vector< double > mSXpos;
00065 std::vector< double > mSYpos;
00066 std::vector< double > mDXpos;
00067 std::vector< double > mDYpos;
00068 std::vector< double > mXbl;
00069 std::vector< double > mYbl;
00070 std::vector< double > mXtr;
00071 std::vector< double > mYtr;
00072
00073 std::set< double > mY ;
00074
00075 double mH , mW , mA , mDensity , mStep;
00076 int mNr ;
00077
00078 };
00079
00080 }
00081 }
00082 }
00083
00084 #endif