Init function now saves the Processor state
State enum created as a public property
This commit is contained in:
Binary file not shown.
@@ -30,32 +30,42 @@ namespace artis::factory {
|
|||||||
|
|
||||||
void Processor::dint(const Time & /* t */) {
|
void Processor::dint(const Time & /* t */) {
|
||||||
// TODO
|
// TODO
|
||||||
|
// Fonction que gère les évolutions internes de ce modèle
|
||||||
}
|
}
|
||||||
|
|
||||||
void Processor::dext(const Time & /* t */, const Time & /* e */, const Bag &bag) {
|
void Processor::dext(const Time & /* t */, const Time & /* e */, const Bag &bag) {
|
||||||
std::for_each(bag.begin(), bag.end(), [](const ExternalEvent & /* event */) {
|
std::for_each(bag.begin(), bag.end(), [](const ExternalEvent & /* event */) {
|
||||||
// TODO
|
// TODO
|
||||||
|
// Fonction gérant les réponses du système aux évents passés via event()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void Processor::start(const Time & /* t */) {
|
void Processor::start(const Time &t) {
|
||||||
// TODO
|
// Démarrage et initialisation
|
||||||
|
|
||||||
|
this->currentState = this->ProcessorState::INIT; // ID de la phase d'état du modèle
|
||||||
|
this->startTime = t;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Time Processor::ta(const Time & /* t */) const {
|
Time Processor::ta(const Time & /* t */) const {
|
||||||
// TODO
|
// TODO
|
||||||
|
// Temps passé dans l'état actuel
|
||||||
return artis::common::DoubleTime::infinity;
|
return artis::common::DoubleTime::infinity;
|
||||||
}
|
}
|
||||||
|
|
||||||
Bag Processor::lambda(const Time & /* t */) const {
|
Bag Processor::lambda(const Time & /* t */) const {
|
||||||
Bag bag;
|
Bag bag;
|
||||||
|
// L'ensemble des sorties de cet objet
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
return bag;
|
return bag;
|
||||||
}
|
}
|
||||||
|
|
||||||
artis::common::event::Value Processor::observe(const Time & /* t */, unsigned int /* index */) const {
|
artis::common::event::Value Processor::observe(const Time & /* t */, unsigned int /* index */) const {
|
||||||
|
// Print de l'état actuel ?
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace artis::factory
|
} // namespace artis::factory
|
||||||
|
|||||||
@@ -78,10 +78,21 @@ public:
|
|||||||
|
|
||||||
artis::common::event::Value observe(const Time &t, unsigned int index) const override;
|
artis::common::event::Value observe(const Time &t, unsigned int index) const override;
|
||||||
|
|
||||||
|
enum ProcessorState{
|
||||||
|
INIT,
|
||||||
|
WAIT,
|
||||||
|
LOADING,
|
||||||
|
PROCESSING,
|
||||||
|
UNLOADING,
|
||||||
|
READY
|
||||||
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// TODO (state)
|
// TODO (state)
|
||||||
|
ProcessorState currentState;
|
||||||
|
Time startTime;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace artis::factory
|
} // namespace artis::factory
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
BIN
test/test_simple
BIN
test/test_simple
Binary file not shown.
Reference in New Issue
Block a user