int FindOptimalParam::Evaluate( double value )
{
- int result=-9999;
- std::string strCommand = Replace( bbGetInputString(), value );
- strCommand=strCommand+" NameFileTransfer="+bbGetInputTransferFile();
- printf("EED FindOptimalParam::Evaluate command=%s\n", strCommand.c_str());
+ int result = -9999;
+ std::string strCommand = Replace( bbGetInputString(), value );
+ strCommand = strCommand+" NameFileTransfer="+bbGetInputTransferFile();
+
+#ifdef __APPLE__
+ strCommand = "source /Users/davila/.bashrc_CreaTools ;" + strCommand;
+#endif
+
+ printf("EED FindOptimalParam::Evaluate command=%s\n", strCommand.c_str());
+ printf("EED FindOptimalParam::Evaluate start... \n", strCommand.c_str());
system( strCommand.c_str() );
- FILE *ff = fopen( bbGetInputTransferFile().c_str() , "r");
+ FILE *ff = fopen( bbGetInputTransferFile().c_str() , "r");
if (ff!=NULL)
{
fscanf(ff,"%d",&result);
printf("EED Warnning!! FindOptimalParam::Evaluate TransferFile not set.\n");
}// ff
fclose(ff);
+ printf("EED FindOptimalParam::Evaluate ...end \n", strCommand.c_str());
return result;
}
-
//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
//=====
} while ( bbGetInputMinDifference() < (end-start) );
bbSetOutputResult(start);
}
-//=====
+
+//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
//=====
void FindOptimalParam::bbUserSetDefaultValues()
{
-
// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
// Here we initialize the input 'In' to 0
bbSetInputInitStart(0);
bbSetInputInitEnd(100);
bbSetInputString("");
bbSetInputMinDifference(1);
-
}
-//=====
+
+//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
//=====
void FindOptimalParam::bbUserInitializeProcessing()
{
-
// THE INITIALIZATION METHOD BODY :
// Here does nothing
// but this is where you should allocate the internal/output pointers
-// if any
-
-
+// if any
}
-//=====
+
+//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
//=====
void FindOptimalParam::bbUserFinalizeProcessing()
{
-
// THE FINALIZATION METHOD BODY :
// Here does nothing
// but this is where you should desallocate the internal/output pointers
// if any
-
}
-}
-// EO namespace bbstd
+
+}// EO namespace bbstd
BBTK_PROCESS(Process);
void Process();
- std::string Replace(std::string command, double value);
- int Evaluate( double value );
-
+ std::string Replace(std::string command, double value);
+ int Evaluate( double value );
//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
BBTK_AUTHOR("InfoDev");
BBTK_DESCRIPTION("No Description.");
BBTK_CATEGORY("empty");
-
BBTK_INPUT(FindOptimalParam,InitStart,"Initial Start",double,"");
BBTK_INPUT(FindOptimalParam,InitEnd,"(defalut 100) Initial End ",double,"");
BBTK_INPUT(FindOptimalParam,MinDifference,"(default 1) Minimum (End-Start) to stop iteration ",double,"");
BBTK_INPUT(FindOptimalParam,String,"String script evaluation (use 'XXvalueXX' to be optimice)",std::string,"");
BBTK_INPUT(FindOptimalParam,TransferFile,"File to check the difference",std::string,"");
-
BBTK_OUTPUT(FindOptimalParam,Result,"Find optimal parameter",double,"");
-
-
BBTK_END_DESCRIBE_BLACK_BOX(FindOptimalParam);
//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
//=====
-}
-// EO namespace bbstd
+
+}// EO namespace bbstd
#endif // __bbstdFindOptimalParam_h_INCLUDED__