Browse Source

Remove Time to start function

Eric Ramat 1 year ago
parent
commit
0284b0569c

+ 1 - 5
src/artis-star/kernel/pdevs/qss/Derivative.hpp

@@ -139,18 +139,14 @@ namespace artis {
                             });
                 }
 
-                virtual typename Time::type
-
-                start(typename Time::type /* time */)
+                virtual void start(typename Time::type /* time */)
                 {
                     _input_number = this->input_port_number();
                     if (_input_number == 0) {
                         _output_value = compute();
                         _state = RESPONSE;
-                        return 0;
                     } else {
                         _state = INIT;
-                        return Time::infinity;
                     }
                 }
 

+ 7 - 4
src/artis-star/kernel/pdevs/qss/Integrator.hpp

@@ -91,8 +91,10 @@ namespace artis {
                             (INIT_VALUE, &Integrator<Time>::_init_value),
                             (CURRENT_VALUE, &Integrator<Time>::_current_value),
                             (EXPECTED_VALUE, &Integrator<Time>::_expected_value)));
-                    DECLARE_STATES(std::vector < double >, ((ARCHIVE_X_DOT, &Integrator<Time>::_archive_x_dot)));
-                    DECLARE_STATES(std::vector <typename Time::type >, ((ARCHIVE_DATE, &Integrator<Time>::_archive_date)));
+                    DECLARE_STATES(std::vector<double>,
+                            ((ARCHIVE_X_DOT, &Integrator<Time>::_archive_x_dot)));
+                    DECLARE_STATES(std::vector<typename Time::type>,
+                            ((ARCHIVE_DATE, &Integrator<Time>::_archive_date)));
 
                     this->input_ports({
                             {QUANTA, "quanta"},
@@ -177,11 +179,10 @@ namespace artis {
                     }
                 }
 
-                virtual typename Time::type start(typename Time::type /* time */)
+                virtual void start(typename Time::type /* time */)
                 {
                     _current_value = _init_value;
                     _state = INIT;
-                    return 0;
                 }
 
                 virtual typename Time::type ta(typename Time::type /* time */)
@@ -189,6 +190,8 @@ namespace artis {
                     double current_derivative;
 
                     switch (_state) {
+                    case INIT:
+                        return 0;
                     case RUNNING:
 
                         assert(_archive_date.size() > 0);

+ 1 - 2
src/artis-star/kernel/pdevs/qss/Quantifier.hpp

@@ -177,11 +177,10 @@ namespace artis {
                     _state = RESPONSE;
                 }
 
-                virtual typename Time::type start(typename Time::type /* time */)
+                virtual void start(typename Time::type /* time */)
                 {
                     _offset = 0;
                     _state = INIT;
-                    return Time::infinity;
                 }
 
                 virtual typename Time::type ta(typename Time::type /* time */)