GCurveSegment::GCurveSegment(GCurveBloc *parent) : GCurvePiece(parent) { //! Don't forget this! InitializeListImportanceParam(); m_Slope = 0; // extra init SetDuration(1.0); SetInitialValue(0.0); SetFinalValue(1.0); }
ForwardEulerSolver::ForwardEulerSolver(int N, double startTime, double endTime, double initialValue){ if (endTime > startTime){ if (N > 1){ SetIterationNumber(N); SetInitialValue(initialValue); SetTimeInterval(startTime, endTime); SetStepSize((endTime - startTime)/(N - 1)); double* output = SolveEquation(); for (int i = 0; i < GetIterationNumber(); ++i) { std::cout << output[i] << " " << GetInitialTime() + i*GetStepSize() << " " << test(GetInitialTime() + i*GetStepSize())<< "\n"; } } else{ std::cerr << "The number of iterations needs to be > 1!!\n"; } } else{ std::cerr << "Final time needs to be after initial!!\n"; } }
void CGameCounter::Spawn(void) { // Save off the initial count SetInitialValue(CountValue()); CRulePointEntity::Spawn(); }