|
Fast Research Interface Library
Manual and Documentation
|
00001 // ---------------------- Doxygen info ---------------------- 00047 // ---------------------------------------------------------- 00048 // For a convenient reading of this file's source code, 00049 // please use a tab width of four characters. 00050 // ---------------------------------------------------------- 00051 00052 00053 00054 #include <TypeIRMLDecision.h> 00055 #include <TypeIRMLMath.h> 00056 00057 00058 //************************************************************************************ 00059 // Decision_1001() 00060 00061 bool TypeIRMLMath::Decision_1001(const double &CurrentVelocity) 00062 { 00063 return(CurrentVelocity >= 0.0); 00064 } 00065 00066 00067 //************************************************************************************ 00068 // Decision_1002() 00069 00070 bool TypeIRMLMath::Decision_1002( const double &CurrentVelocity 00071 , const double &MaxVelocity) 00072 { 00073 return(CurrentVelocity <= MaxVelocity); 00074 } 00075 00076 00077 //************************************************************************************ 00078 // Decision_1003() 00079 00080 bool TypeIRMLMath::Decision_1003( const double &CurrentPosition 00081 , const double &CurrentVelocity 00082 , const double &MaxAcceleration 00083 , const double &TargetPosition) 00084 { 00085 return((CurrentPosition + 0.5 * pow2(CurrentVelocity) / MaxAcceleration) <= TargetPosition); 00086 } 00087 00088 00089 //************************************************************************************ 00090 // Decision_1004() 00091 00092 bool TypeIRMLMath::Decision_1004( const double &CurrentPosition 00093 , const double &CurrentVelocity 00094 , const double &MaxVelocity 00095 , const double &MaxAcceleration 00096 , const double &TargetPosition) 00097 { 00098 return( (CurrentPosition + (2.0 * pow2(MaxVelocity) - pow2(CurrentVelocity)) 00099 / (2.0 * MaxAcceleration) ) <= TargetPosition ); 00100 } 00101 00102 00103 //************************************************************************************ 00104 // Decision_2001() 00105 00106 bool TypeIRMLMath::Decision_2001(const double &CurrentVelocity) 00107 { 00108 return(TypeIRMLMath::Decision_1001(CurrentVelocity)); 00109 } 00110 00111 00112 //************************************************************************************ 00113 // Decision_2002() 00114 00115 bool TypeIRMLMath::Decision_2002( const double &CurrentVelocity 00116 , const double &MaxVelocity) 00117 { 00118 return(TypeIRMLMath::Decision_1002( CurrentVelocity 00119 , MaxVelocity)); 00120 } 00121 00122 00123 //************************************************************************************ 00124 // Decision_2003() 00125 00126 bool TypeIRMLMath::Decision_2003( const double &CurrentPosition 00127 , const double &CurrentVelocity 00128 , const double &MaxAcceleration 00129 , const double &TargetPosition) 00130 { 00131 return(TypeIRMLMath::Decision_1003( CurrentPosition 00132 , CurrentVelocity 00133 , MaxAcceleration 00134 , TargetPosition )); 00135 } 00136 00137 00138 //************************************************************************************ 00139 // Decision_2004() 00140 00141 bool TypeIRMLMath::Decision_2004( const double &CurrentPosition 00142 , const double &CurrentVelocity 00143 , const double &MaxAcceleration 00144 , const double &TargetPosition 00145 , const double &SynchronizationTime) 00146 { 00147 return((CurrentPosition + SynchronizationTime * CurrentVelocity 00148 - 0.5 * pow2(CurrentVelocity) / MaxAcceleration) <= TargetPosition); 00149 }