diff --git a/source/branches/CLASSV3/include/CLASSBackEnd.hxx b/source/branches/CLASSV3/include/CLASSBackEnd.hxx index 58d5b355028c89ff138bb49c086db755a5f6f260..4bcd5c7420f762b07c7b83355c67b48ed64ed56f 100644 --- a/source/branches/CLASSV3/include/CLASSBackEnd.hxx +++ b/source/branches/CLASSV3/include/CLASSBackEnd.hxx @@ -11,6 +11,8 @@ #include <string> #include <fstream> +#include <map> + #include "CLASSFacility.hxx" #include "IsotopicVector.hxx" @@ -59,6 +61,8 @@ class CLASSBackEnd : public CLASSFacility #ifndef __CINT__ DecayDataBank* GetDecayDataBank() { return fDecayDataBase;} //!< Return the pointer to the decay DataBank CLASSBackEnd* GetOutBackEndFacility() const { return fOutBackEndFacility;} //!<Return the pointer to the OUtBackEndFacility + virtual map<cSecond,int> GetTheBackEndTimePath(); + #endif //@} diff --git a/source/branches/CLASSV3/include/CLASSHeaders.hxx b/source/branches/CLASSV3/include/CLASSHeaders.hxx index 9451d39db17c848170dc339fc89fb4636642cf68..dbd173fd7b449f83e29dd7e7011f93000f351cfa 100755 --- a/source/branches/CLASSV3/include/CLASSHeaders.hxx +++ b/source/branches/CLASSV3/include/CLASSHeaders.hxx @@ -10,6 +10,7 @@ #include "Reactor.hxx" #include "Pool.hxx" #include "FabricationPlant.hxx" +#include "SeparationPlant.hxx" #include "Storage.hxx" #include "IsotopicVector.hxx" #include "ZAI.hxx" diff --git a/source/branches/CLASSV3/include/Scenario.hxx b/source/branches/CLASSV3/include/Scenario.hxx index bd7511f430197d04732c911e45e65eed1c365bf5..3f889dedc1696e5341073859bb90783461788aaa 100755 --- a/source/branches/CLASSV3/include/Scenario.hxx +++ b/source/branches/CLASSV3/include/Scenario.hxx @@ -22,6 +22,7 @@ typedef long long int cSecond; class DecayDataBank; class FabricationPlant; +class SeparationPlant; class Reactor; class Pool; class Storage; @@ -88,7 +89,7 @@ public : string GetOutputFileName() { return fOutputFileName; } ///< Return the Output File name string GetOutputTreeName() { return fOutputTreeName; } ///< Return the Output ROOT TTree name - map<cSecond,int> GetTheBackEndTimePath(Reactor* reactor); ///< BUild and return the time path of a iradiated fuel + IsotopicVector GetWaste() { return fWaste;} ///< Return the waste IsotopicVcetor //@} @@ -160,11 +161,13 @@ public : void AddReactor(Reactor* reactor); ///< Add a Reactor to the Park void AddStorage(Storage* storage); ///< Add a Storage to the Park void AddFabricationPlant(FabricationPlant* fabricationplant); ///< Add a Storage to the Park - + void AddSeparationPlant(SeparationPlant* separationplant); + void Add(Pool* Pool) {AddPool(Pool);} ///< Add a Pool to the Park void Add(Reactor* reactor) {AddReactor(reactor);} ///< Add a Reactor to the Park void Add(Storage* storage) {AddStorage(storage);} ///< Add a Storage to the Park void Add(FabricationPlant* fabricationplant) {AddFabricationPlant(fabricationplant);}///< Add a Storage to the Park + void Add(SeparationPlant* separationplant) {AddSeparationPlant(separationplant);}///< Add a Storage to the Park //@} diff --git a/source/branches/CLASSV3/include/SeparationPlant.hxx b/source/branches/CLASSV3/include/SeparationPlant.hxx index 8de81f287fcb66eb815fff2aa424cb578a5487f6..3e86a6b64c45a22d693310e91b56842668cc8b6a 100644 --- a/source/branches/CLASSV3/include/SeparationPlant.hxx +++ b/source/branches/CLASSV3/include/SeparationPlant.hxx @@ -97,6 +97,7 @@ public : //@} + map<cSecond,int> GetTheBackEndTimePath(); //********* IsotopicVector Managment Method *********// diff --git a/source/branches/CLASSV3/src/CLASSBackEnd.cxx b/source/branches/CLASSV3/src/CLASSBackEnd.cxx index 2f347d704c3bce7115d7f04390934a640c9b4919..03870e12e5bc8783d975b22130a07b51d3e32a63 100644 --- a/source/branches/CLASSV3/src/CLASSBackEnd.cxx +++ b/source/branches/CLASSV3/src/CLASSBackEnd.cxx @@ -64,6 +64,7 @@ void CLASSBackEnd::AddIV(IsotopicVector isotopicvector) //________________________________________________________________________ IsotopicVector CLASSBackEnd::GetDecay(IsotopicVector isotopicvector, cSecond t) { + DBGL IsotopicVector IV; @@ -78,6 +79,38 @@ IsotopicVector CLASSBackEnd::GetDecay(IsotopicVector isotopicvector, cSecond t) } } + DBGL return IV; - } + + +map<cSecond,int> CLASSBackEnd::GetTheBackEndTimePath() +{ + DBGL + map<cSecond, int> TheBackEndTimePath; + + if(!fIsStorageType) + { + int FacilityType = GetFacilityType(); + cSecond step = GetCycleTime(); + + pair< map<cSecond, int>::iterator, bool > IResult = TheBackEndTimePath.insert(pair<cSecond,int> (step, FacilityType)); + if( !IResult.second ) IResult.first->second |= FacilityType; + + map<cSecond, int> TheBackEndTimePath_tmp = GetOutBackEndFacility()->GetTheBackEndTimePath(); + + map<cSecond, int>::iterator it; + for (it = TheBackEndTimePath_tmp.begin(); it != TheBackEndTimePath_tmp.end(); it++) + { + pair< map<cSecond, int>::iterator, bool > IResult; + + IResult = TheBackEndTimePath.insert( pair<cSecond ,int>(step + (*it).first, (*it).second) ); + if( !IResult.second ) + IResult.first->second |= (*it).second; + + } + } + + DBGL + return TheBackEndTimePath; +} \ No newline at end of file diff --git a/source/branches/CLASSV3/src/Scenario.cxx b/source/branches/CLASSV3/src/Scenario.cxx index 41b1ee9b3a094bc9535f1c3e3f278c974b11a585..36d80e9ebf6ba0762b14d4659f75e080000e6f85 100755 --- a/source/branches/CLASSV3/src/Scenario.cxx +++ b/source/branches/CLASSV3/src/Scenario.cxx @@ -15,6 +15,7 @@ #include "CLASSBackEnd.hxx" #include "Pool.hxx" #include "FabricationPlant.hxx" +#include "SeparationPlant.hxx" #include "CLASSLogger.hxx" @@ -308,36 +309,45 @@ void Scenario::AddFabricationPlant(FabricationPlant* fabricationplant) fOutT->Branch(fFabricationPlant.back()->GetName(), "FabricationPlant", &fFabricationPlant.back()); } //________________________________________________________________________ -map<cSecond,int> Scenario::GetTheBackEndTimePath(Reactor* reactor) +void Scenario::AddSeparationPlant(SeparationPlant* SeparationPlant) { - cSecond step = 0; - map<cSecond, int> TheBackEndTimePath; - { - pair< map<cSecond, int>::iterator, bool > IResult; - // IResult = TheBackEndTimePath.insert(pair<cSecond, double> ( step,reactor->GetFacilityType() ) ); - // if( !IResult.second ) IResult.first->second |= reactor->GetFacilityType(); - - } + fSeparationPlant.push_back(SeparationPlant); + fSeparationPlant.back()->SetParc(this); + fSeparationPlant.back()->SetDecayDataBank( (*this).GetDecayDataBase() ); + fSeparationPlant.back()->SetLog(GetLog()); + fSeparationPlant.back()->SetId((int)fSeparationPlant.size()-1); + fSeparationPlant.back()->SetCreationTime(fAbsoluteTime); - vector<CLASSBackEnd*> BackEndPath; - BackEndPath.push_back(reactor->GetOutBackEndFacility()); - while (!BackEndPath.back()->GetStorageType()) + string SeparationPlant_name = fSeparationPlant.back()->GetName(); + if(SeparationPlant_name == "C_SepPlant.") { - step += BackEndPath.back()->GetCycleTime(); - int FacilityType = BackEndPath.back()->GetFacilityType(); - pair< map<cSecond, int>::iterator, bool > IResult = TheBackEndTimePath.insert(pair<cSecond,int> (step, FacilityType)); - if( !IResult.second ) IResult.first->second |= FacilityType; - - BackEndPath.push_back(BackEndPath[BackEndPath.size()-1]->GetOutBackEndFacility()); - + SeparationPlant_name = "C_SepPlant"; + SeparationPlant_name += dtoa(fSeparationPlant.back()->GetId()); + SeparationPlant_name += "."; + fSeparationPlant.back()->SetName(SeparationPlant_name.c_str()); + } + else + { + string name_tmp = SeparationPlant_name; + SeparationPlant_name = "C_"; + SeparationPlant_name += name_tmp; + SeparationPlant_name += "."; + fSeparationPlant.back()->SetName(SeparationPlant_name.c_str()); } - return TheBackEndTimePath; + if(!fNewTtree) + fOutT->Branch(fSeparationPlant.back()->GetName(), "SeparationPlant", &fSeparationPlant.back()); + + } + +//________________________________________________________________________ + + //________________________________________________________________________ void Scenario::BuildTimeVector(cSecond t) { @@ -400,8 +410,9 @@ void Scenario::BuildTimeVector(cSecond t) cSecond step = R_StartingTime; - map< cSecond, int > R_BackEndTimePath = GetTheBackEndTimePath(fReactor[i]); - if( typeid(R_Fuel.first) == typeid(PhysicsModels) ) + map< cSecond, int > R_BackEndTimePath = fReactor[i]->GetOutBackEndFacility()->GetTheBackEndTimePath(); + + if( R_Fuel.first.GetPhysicsModels() ) F_CycleTime = fReactor[i]->GetFabricationPlant()->GetCycleTime(); diff --git a/source/branches/CLASSV3/src/SeparationPlant.cxx b/source/branches/CLASSV3/src/SeparationPlant.cxx index 4edf2edc69fc9c2d9146fac5dfc2388ade45b40c..349ea26ec32ecf85d15499838e932d86729cc7dc 100644 --- a/source/branches/CLASSV3/src/SeparationPlant.cxx +++ b/source/branches/CLASSV3/src/SeparationPlant.cxx @@ -22,7 +22,7 @@ ClassImp(SeparationPlant) -SeparationPlant::SeparationPlant():CLASSBackEnd(8) +SeparationPlant::SeparationPlant():CLASSBackEnd(-2) { fOutBackEndFacility = 0; SetName("C_SeparationPlant."); @@ -30,7 +30,7 @@ SeparationPlant::SeparationPlant():CLASSBackEnd(8) } //________________________________________________________________________ -SeparationPlant::SeparationPlant(CLASSLogger* log, cSecond separationtime):CLASSBackEnd(log, separationtime, 8) +SeparationPlant::SeparationPlant(CLASSLogger* log, cSecond separationtime):CLASSBackEnd(log, separationtime, -2) { @@ -65,6 +65,7 @@ SeparationPlant::~SeparationPlant() //________________________________________________________________________ void SeparationPlant::SetStorageDestination(CLASSBackEnd* storagedestination, IsotopicVector isotopicvector, cSecond destinationstartingtime) { + DBGL fDestinationStorageStartingTime.push_back(destinationstartingtime); fDestinationStorage.push_back(storagedestination); @@ -90,12 +91,14 @@ les pertes non gérées -> WASTE par défaut */ + DBGL + } void SeparationPlant::AddIV(IsotopicVector IV) { - +DBGL for(int fds=0; fds<(int)fDestinationStorage.size(); fds++) { cSecond CurrentTime = GetParc()->GetAbsoluteTime(); @@ -111,15 +114,43 @@ void SeparationPlant::AddIV(IsotopicVector IV) fDestinationStorage[fds]->AddIV(IVtmp); IV -= IVtmp; } - //IV.Print(); } GetParc()->AddWaste(IV); + DBGL +} + + +map<cSecond,int> SeparationPlant::GetTheBackEndTimePath() +{ + DBGL + + map<cSecond, int> TheBackEndTimePath; + for( int i = 0; i < (int)fDestinationStorage.size(); i++ ) + { + map<cSecond, int> TheBackEndTimePath_tmp = fDestinationStorage[i]->GetTheBackEndTimePath(); + map<cSecond, int>::iterator it; + for (it = TheBackEndTimePath_tmp.begin(); it != TheBackEndTimePath_tmp.end(); it++) + { + pair< map<cSecond, int>::iterator, bool > IResult; + IResult = TheBackEndTimePath.insert( pair<cSecond ,int>((*it).first, (*it).second) ); + if( !IResult.second ) + IResult.first->second |= (*it).second; + + } + } + + DBGL + return TheBackEndTimePath; } + + + + //________________________________________________________________________ // Time Action with the reste of the Universe : // Out Storage