Sink, WIP
This commit is contained in:
@@ -2,34 +2,44 @@
|
|||||||
<CodeBlocks_layout_file>
|
<CodeBlocks_layout_file>
|
||||||
<FileVersion major="1" minor="0" />
|
<FileVersion major="1" minor="0" />
|
||||||
<ActiveTarget name="test_simple" />
|
<ActiveTarget name="test_simple" />
|
||||||
|
<File name="src/Processor.cpp" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor>
|
||||||
|
<Cursor1 position="1887" topLine="95" />
|
||||||
|
</Cursor>
|
||||||
|
</File>
|
||||||
<File name="src/PoolRouter.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
<File name="src/PoolRouter.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
<Cursor>
|
<Cursor>
|
||||||
<Cursor1 position="0" topLine="116" />
|
<Cursor1 position="0" topLine="116" />
|
||||||
</Cursor>
|
</Cursor>
|
||||||
</File>
|
</File>
|
||||||
<File name="src/Processor.cpp" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="2504" topLine="60" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="src/ProductionOrder.hpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="0" topLine="60" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="src/Processor.hpp" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="1" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="1175" topLine="15" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="src/Machine.hpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="0" topLine="6" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="src/ItemStock.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
<File name="src/ItemStock.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
<Cursor>
|
<Cursor>
|
||||||
<Cursor1 position="0" topLine="24" />
|
<Cursor1 position="0" topLine="24" />
|
||||||
</Cursor>
|
</Cursor>
|
||||||
</File>
|
</File>
|
||||||
|
<File name="src/Processor.hpp" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="1" zoom_2="0">
|
||||||
|
<Cursor>
|
||||||
|
<Cursor1 position="1175" topLine="15" />
|
||||||
|
</Cursor>
|
||||||
|
</File>
|
||||||
|
<File name="src/Sink.cpp" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor>
|
||||||
|
<Cursor1 position="0" topLine="18" />
|
||||||
|
</Cursor>
|
||||||
|
</File>
|
||||||
|
<File name="src/Machine.hpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor>
|
||||||
|
<Cursor1 position="0" topLine="6" />
|
||||||
|
</Cursor>
|
||||||
|
</File>
|
||||||
|
<File name="src/ProductionOrder.hpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor>
|
||||||
|
<Cursor1 position="0" topLine="60" />
|
||||||
|
</Cursor>
|
||||||
|
</File>
|
||||||
|
<File name="src/Sink.hpp" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor>
|
||||||
|
<Cursor1 position="0" topLine="0" />
|
||||||
|
</Cursor>
|
||||||
|
</File>
|
||||||
</CodeBlocks_layout_file>
|
</CodeBlocks_layout_file>
|
||||||
|
|||||||
Binary file not shown.
@@ -5307,7 +5307,6 @@ src/CMakeFiles/factory_core.dir/Processor.cpp.o
|
|||||||
/usr/include/c++/13/initializer_list
|
/usr/include/c++/13/initializer_list
|
||||||
/usr/include/c++/13/ios
|
/usr/include/c++/13/ios
|
||||||
/usr/include/c++/13/iosfwd
|
/usr/include/c++/13/iosfwd
|
||||||
/usr/include/c++/13/iostream
|
|
||||||
/usr/include/c++/13/istream
|
/usr/include/c++/13/istream
|
||||||
/usr/include/c++/13/iterator
|
/usr/include/c++/13/iterator
|
||||||
/usr/include/c++/13/limits
|
/usr/include/c++/13/limits
|
||||||
|
|||||||
@@ -5302,7 +5302,6 @@ src/CMakeFiles/factory_core.dir/Processor.cpp.o: src/Processor.cpp \
|
|||||||
/usr/include/c++/13/initializer_list \
|
/usr/include/c++/13/initializer_list \
|
||||||
/usr/include/c++/13/ios \
|
/usr/include/c++/13/ios \
|
||||||
/usr/include/c++/13/iosfwd \
|
/usr/include/c++/13/iosfwd \
|
||||||
/usr/include/c++/13/iostream \
|
|
||||||
/usr/include/c++/13/istream \
|
/usr/include/c++/13/istream \
|
||||||
/usr/include/c++/13/iterator \
|
/usr/include/c++/13/iterator \
|
||||||
/usr/include/c++/13/limits \
|
/usr/include/c++/13/limits \
|
||||||
@@ -12735,8 +12734,6 @@ src/ProductionOrder.hpp:
|
|||||||
|
|
||||||
/usr/include/c++/13/tr1/ell_integral.tcc:
|
/usr/include/c++/13/tr1/ell_integral.tcc:
|
||||||
|
|
||||||
/usr/include/c++/13/iostream:
|
|
||||||
|
|
||||||
/usr/include/c++/13/bits/hash_bytes.h:
|
/usr/include/c++/13/bits/hash_bytes.h:
|
||||||
|
|
||||||
/usr/include/boost/smart_ptr/shared_ptr.hpp:
|
/usr/include/boost/smart_ptr/shared_ptr.hpp:
|
||||||
|
|||||||
40
src/Sink.cpp
40
src/Sink.cpp
@@ -26,24 +26,51 @@
|
|||||||
|
|
||||||
#include "Sink.hpp"
|
#include "Sink.hpp"
|
||||||
|
|
||||||
namespace artis::factory {
|
namespace artis::factory { // TODO : Peut être qu'il manque du code dans cette classe. Pour le moment, le test tourne à l'infini. Trouver où ça coince et ce qu'il manque
|
||||||
|
|
||||||
void Sink::dint(const Time &/*t*/) {
|
void Sink::dint(const Time &/*t*/) {
|
||||||
// TODO
|
// TODO
|
||||||
|
// Inutile si l'on consiède que cet élément ce fait que recevoir des POs. Il ne fait rien par lui-même, et ne varie que en fonction de son environnement.
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sink::dext(const Time & /* t */, const Time & /* e */, const Bag &bag) {
|
void Sink::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(), [this, t](const ExternalEvent &event) {
|
||||||
// TODO
|
|
||||||
|
if (event.port_index() == inputs::IN) {
|
||||||
|
uint8_t *data = nullptr;
|
||||||
|
|
||||||
|
event.data()(data);
|
||||||
|
std::unique_ptr<ProductionOrder> po = std::make_unique<ProductionOrder>(data, event.data().size());
|
||||||
|
#ifdef WITH_TRACE
|
||||||
|
Trace::trace()
|
||||||
|
<< TraceElement(get_name(), t,
|
||||||
|
artis::common::FormalismType::PDEVS,
|
||||||
|
artis::common::FunctionType::DELTA_EXT,
|
||||||
|
artis::common::LevelType::USER)
|
||||||
|
<< "Sink received po = " << po->to_string();
|
||||||
|
Trace::trace().flush();
|
||||||
|
#endif
|
||||||
|
_pos.push_back(std::move(po));//Je ne peux pas dupliquer ce pointer unique dans la liste, je dois explicitement le déplacer.
|
||||||
|
_phase = Phase::LOADED;
|
||||||
|
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sink::start(const Time & /* t */) {
|
void Sink::start(const Time & /* t */) {
|
||||||
// TODO
|
_phase = Phase::INIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
Time Sink::ta(const Time & /* t */) const {
|
Time Sink::ta(const Time & /* t */) const {
|
||||||
// TODO
|
switch (_phase) {
|
||||||
|
case Phase::INIT:// Phase transitoire, je n'y reste pas, le modèle ne fait qu'y passer
|
||||||
|
case Phase::READY:// Idem
|
||||||
|
//case Phase::UNLOADING:// Déchargement des PO dans la sortie, ce n'est que transitoire
|
||||||
|
return 0;
|
||||||
|
case Phase::WAIT:// J'attends un premier PO, potentiellement infini
|
||||||
|
case Phase::LOADED:// J'ai un PO en stock, j'attends d'en faire quelque chose,ce qui est potentiellement infini
|
||||||
|
return artis::common::DoubleTime::infinity;
|
||||||
|
}
|
||||||
return artis::common::DoubleTime::infinity;
|
return artis::common::DoubleTime::infinity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,6 +78,7 @@ Bag Sink::lambda(const Time & /* t */) const {
|
|||||||
Bag bag;
|
Bag bag;
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
// Pour le moment, Sink ne laisse pas sortir les POs arrivés dedans. Inutile de définir ceci.
|
||||||
return bag;
|
return bag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
34
src/Sink.hpp
34
src/Sink.hpp
@@ -34,6 +34,7 @@
|
|||||||
namespace artis::factory {
|
namespace artis::factory {
|
||||||
|
|
||||||
struct SinkParameters : MachineParameters {
|
struct SinkParameters : MachineParameters {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class Sink : public Dynamics<Sink, SinkParameters> {
|
class Sink : public Dynamics<Sink, SinkParameters> {
|
||||||
@@ -76,9 +77,38 @@ 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;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// TODO (state)
|
struct Phase {
|
||||||
|
enum values {
|
||||||
|
INIT,
|
||||||
|
READY,
|
||||||
|
WAIT,
|
||||||
|
LOADED,
|
||||||
|
//UNLOADING
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static std::string to_string(const values &value) {
|
||||||
|
switch (value) {
|
||||||
|
case INIT:
|
||||||
|
return "INIT";
|
||||||
|
case READY:
|
||||||
|
return "READY";
|
||||||
|
case WAIT:
|
||||||
|
return "WAIT";
|
||||||
|
case LOADED:
|
||||||
|
return "LOADED";
|
||||||
|
/*case UNLOADING:
|
||||||
|
return "UNLOADING";*/
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Phase::values _phase;
|
||||||
|
std::vector<std::unique_ptr<ProductionOrder>> _pos;
|
||||||
|
}; // class Sink
|
||||||
|
|
||||||
} // namespace artis::factory
|
} // namespace artis::factory
|
||||||
|
|
||||||
#endif
|
#endif // ARTIS_FACTORY_SINK_HPP
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -10,6 +10,7 @@ test/CMakeFiles/test_simple.dir/test_simple.cpp.o
|
|||||||
/home/lj50/Univ/M2/Modelisation_problemes/simulation/src/ProductionOrder.hpp
|
/home/lj50/Univ/M2/Modelisation_problemes/simulation/src/ProductionOrder.hpp
|
||||||
/home/lj50/Univ/M2/Modelisation_problemes/simulation/src/ProductionOrderGenerator.hpp
|
/home/lj50/Univ/M2/Modelisation_problemes/simulation/src/ProductionOrderGenerator.hpp
|
||||||
/home/lj50/Univ/M2/Modelisation_problemes/simulation/src/Router.hpp
|
/home/lj50/Univ/M2/Modelisation_problemes/simulation/src/Router.hpp
|
||||||
|
/home/lj50/Univ/M2/Modelisation_problemes/simulation/src/Sink.hpp
|
||||||
/usr/include/alloca.h
|
/usr/include/alloca.h
|
||||||
/usr/include/asm-generic/errno-base.h
|
/usr/include/asm-generic/errno-base.h
|
||||||
/usr/include/asm-generic/errno.h
|
/usr/include/asm-generic/errno.h
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ test/CMakeFiles/test_simple.dir/test_simple.cpp.o: test/test_simple.cpp \
|
|||||||
src/ProductionOrder.hpp \
|
src/ProductionOrder.hpp \
|
||||||
src/ProductionOrderGenerator.hpp \
|
src/ProductionOrderGenerator.hpp \
|
||||||
src/Router.hpp \
|
src/Router.hpp \
|
||||||
|
src/Sink.hpp \
|
||||||
/usr/include/alloca.h \
|
/usr/include/alloca.h \
|
||||||
/usr/include/asm-generic/errno-base.h \
|
/usr/include/asm-generic/errno-base.h \
|
||||||
/usr/include/asm-generic/errno.h \
|
/usr/include/asm-generic/errno.h \
|
||||||
@@ -1742,12 +1743,6 @@ test/CMakeFiles/test_simple.dir/test_simple.cpp.o: test/test_simple.cpp \
|
|||||||
|
|
||||||
/usr/include/boost/mpl/aux_/preprocessed/gcc/full_lambda.hpp:
|
/usr/include/boost/mpl/aux_/preprocessed/gcc/full_lambda.hpp:
|
||||||
|
|
||||||
/usr/include/boost/preprocessor/inc.hpp:
|
|
||||||
|
|
||||||
/usr/include/boost/preprocessor/array/size.hpp:
|
|
||||||
|
|
||||||
/usr/include/boost/mpl/aux_/preprocessed/gcc/bind_fwd.hpp:
|
|
||||||
|
|
||||||
/usr/include/boost/mpl/aux_/preprocessed/gcc/or.hpp:
|
/usr/include/boost/mpl/aux_/preprocessed/gcc/or.hpp:
|
||||||
|
|
||||||
/usr/include/boost/optional/detail/optional_swap.hpp:
|
/usr/include/boost/optional/detail/optional_swap.hpp:
|
||||||
@@ -1902,6 +1897,10 @@ test/CMakeFiles/test_simple.dir/test_simple.cpp.o: test/test_simple.cpp \
|
|||||||
|
|
||||||
/usr/include/boost/mpl/aux_/config/ctps.hpp:
|
/usr/include/boost/mpl/aux_/config/ctps.hpp:
|
||||||
|
|
||||||
|
/usr/include/boost/mpl/aux_/config/bind.hpp:
|
||||||
|
|
||||||
|
/usr/include/boost/type_traits/remove_bounds.hpp:
|
||||||
|
|
||||||
/usr/include/boost/intrusive/detail/algo_type.hpp:
|
/usr/include/boost/intrusive/detail/algo_type.hpp:
|
||||||
|
|
||||||
src/Processor.hpp:
|
src/Processor.hpp:
|
||||||
@@ -2134,6 +2133,12 @@ test/test_simple.cpp:
|
|||||||
|
|
||||||
/usr/include/boost/core/demangle.hpp:
|
/usr/include/boost/core/demangle.hpp:
|
||||||
|
|
||||||
|
/usr/include/stdlib.h:
|
||||||
|
|
||||||
|
/usr/include/boost/aligned_storage.hpp:
|
||||||
|
|
||||||
|
/usr/include/boost/preprocessor/repetition/for.hpp:
|
||||||
|
|
||||||
/usr/include/boost/preprocessor/comparison/limits/not_equal_256.hpp:
|
/usr/include/boost/preprocessor/comparison/limits/not_equal_256.hpp:
|
||||||
|
|
||||||
/usr/include/x86_64-linux-gnu/bits/floatn.h:
|
/usr/include/x86_64-linux-gnu/bits/floatn.h:
|
||||||
@@ -2172,6 +2177,10 @@ test/test_simple.cpp:
|
|||||||
|
|
||||||
/usr/include/stdio.h:
|
/usr/include/stdio.h:
|
||||||
|
|
||||||
|
/usr/include/x86_64-linux-gnu/bits/strings_fortified.h:
|
||||||
|
|
||||||
|
/usr/include/boost/mpl/aux_/preprocessed/gcc/quote.hpp:
|
||||||
|
|
||||||
/usr/include/c++/13/bits/std_abs.h:
|
/usr/include/c++/13/bits/std_abs.h:
|
||||||
|
|
||||||
/usr/include/linux/errno.h:
|
/usr/include/linux/errno.h:
|
||||||
@@ -2232,16 +2241,22 @@ src/Base.hpp:
|
|||||||
|
|
||||||
/usr/include/boost/intrusive/detail/default_header_holder.hpp:
|
/usr/include/boost/intrusive/detail/default_header_holder.hpp:
|
||||||
|
|
||||||
|
src/Sink.hpp:
|
||||||
|
|
||||||
|
/usr/include/boost/mpl/integral_c.hpp:
|
||||||
|
|
||||||
|
/usr/include/boost/parameter/required.hpp:
|
||||||
|
|
||||||
|
/usr/include/boost/core/pointer_traits.hpp:
|
||||||
|
|
||||||
|
/usr/include/boost/parameter/aux_/pack/tag_deduced.hpp:
|
||||||
|
|
||||||
/usr/include/boost/config/no_tr1/memory.hpp:
|
/usr/include/boost/config/no_tr1/memory.hpp:
|
||||||
|
|
||||||
/usr/include/boost/config/platform/linux.hpp:
|
/usr/include/boost/config/platform/linux.hpp:
|
||||||
|
|
||||||
/usr/include/boost/smart_ptr/detail/sp_convertible.hpp:
|
/usr/include/boost/smart_ptr/detail/sp_convertible.hpp:
|
||||||
|
|
||||||
/usr/include/boost/mpl/integral_c.hpp:
|
|
||||||
|
|
||||||
/usr/include/boost/parameter/required.hpp:
|
|
||||||
|
|
||||||
/usr/include/boost/concept/detail/general.hpp:
|
/usr/include/boost/concept/detail/general.hpp:
|
||||||
|
|
||||||
/usr/include/boost/preprocessor/detail/check.hpp:
|
/usr/include/boost/preprocessor/detail/check.hpp:
|
||||||
@@ -2264,12 +2279,6 @@ src/Base.hpp:
|
|||||||
|
|
||||||
/usr/include/boost/core/cmath.hpp:
|
/usr/include/boost/core/cmath.hpp:
|
||||||
|
|
||||||
/usr/include/stdlib.h:
|
|
||||||
|
|
||||||
/usr/include/boost/aligned_storage.hpp:
|
|
||||||
|
|
||||||
/usr/include/boost/preprocessor/repetition/for.hpp:
|
|
||||||
|
|
||||||
/usr/include/boost/core/allocator_access.hpp:
|
/usr/include/boost/core/allocator_access.hpp:
|
||||||
|
|
||||||
/usr/include/asm-generic/errno-base.h:
|
/usr/include/asm-generic/errno-base.h:
|
||||||
@@ -2304,12 +2313,6 @@ src/Base.hpp:
|
|||||||
|
|
||||||
/usr/include/boost/range/config.hpp:
|
/usr/include/boost/range/config.hpp:
|
||||||
|
|
||||||
/usr/include/boost/mpl/aux_/traits_lambda_spec.hpp:
|
|
||||||
|
|
||||||
/usr/include/boost/format/detail/unset_macros.hpp:
|
|
||||||
|
|
||||||
/usr/include/c++/13/bits/vector.tcc:
|
|
||||||
|
|
||||||
/usr/include/boost/mpl/aux_/config/eti.hpp:
|
/usr/include/boost/mpl/aux_/config/eti.hpp:
|
||||||
|
|
||||||
/usr/include/boost/config/compiler/gcc.hpp:
|
/usr/include/boost/config/compiler/gcc.hpp:
|
||||||
@@ -2332,10 +2335,6 @@ src/Base.hpp:
|
|||||||
|
|
||||||
/usr/include/boost/container/container_fwd.hpp:
|
/usr/include/boost/container/container_fwd.hpp:
|
||||||
|
|
||||||
/usr/include/boost/core/pointer_traits.hpp:
|
|
||||||
|
|
||||||
/usr/include/boost/parameter/aux_/pack/tag_deduced.hpp:
|
|
||||||
|
|
||||||
/usr/include/c++/13/bits/ios_base.h:
|
/usr/include/c++/13/bits/ios_base.h:
|
||||||
|
|
||||||
/usr/include/boost/move/detail/pointer_element.hpp:
|
/usr/include/boost/move/detail/pointer_element.hpp:
|
||||||
@@ -2374,6 +2373,12 @@ src/Base.hpp:
|
|||||||
|
|
||||||
/usr/include/boost/intrusive/detail/function_detector.hpp:
|
/usr/include/boost/intrusive/detail/function_detector.hpp:
|
||||||
|
|
||||||
|
/usr/include/boost/mpl/aux_/traits_lambda_spec.hpp:
|
||||||
|
|
||||||
|
/usr/include/boost/format/detail/unset_macros.hpp:
|
||||||
|
|
||||||
|
/usr/include/c++/13/bits/vector.tcc:
|
||||||
|
|
||||||
/usr/include/boost/parameter/template_keyword.hpp:
|
/usr/include/boost/parameter/template_keyword.hpp:
|
||||||
|
|
||||||
/usr/include/boost/intrusive/detail/ebo_functor_holder.hpp:
|
/usr/include/boost/intrusive/detail/ebo_functor_holder.hpp:
|
||||||
@@ -2680,9 +2685,11 @@ src/Base.hpp:
|
|||||||
|
|
||||||
/usr/include/boost/mpl/aux_/config/bcc.hpp:
|
/usr/include/boost/mpl/aux_/config/bcc.hpp:
|
||||||
|
|
||||||
/usr/include/boost/mpl/aux_/config/bind.hpp:
|
/usr/include/boost/preprocessor/array/size.hpp:
|
||||||
|
|
||||||
/usr/include/boost/type_traits/remove_bounds.hpp:
|
/usr/include/boost/mpl/aux_/preprocessed/gcc/bind_fwd.hpp:
|
||||||
|
|
||||||
|
/usr/include/boost/preprocessor/inc.hpp:
|
||||||
|
|
||||||
/usr/include/boost/mpl/aux_/config/use_preprocessed.hpp:
|
/usr/include/boost/mpl/aux_/config/use_preprocessed.hpp:
|
||||||
|
|
||||||
@@ -2694,10 +2701,6 @@ src/Base.hpp:
|
|||||||
|
|
||||||
/usr/include/boost/preprocessor/list/detail/limits/fold_right_256.hpp:
|
/usr/include/boost/preprocessor/list/detail/limits/fold_right_256.hpp:
|
||||||
|
|
||||||
/usr/include/boost/mpl/aux_/preprocessed/gcc/quote.hpp:
|
|
||||||
|
|
||||||
/usr/include/x86_64-linux-gnu/bits/strings_fortified.h:
|
|
||||||
|
|
||||||
/usr/include/boost/preprocessor/list/reverse.hpp:
|
/usr/include/boost/preprocessor/list/reverse.hpp:
|
||||||
|
|
||||||
/usr/include/boost/mpl/aux_/config/gcc.hpp:
|
/usr/include/boost/mpl/aux_/config/gcc.hpp:
|
||||||
|
|||||||
Binary file not shown.
@@ -1123,4 +1123,5 @@ test/CMakeFiles/test_simple.dir/test_simple.cpp.o: \
|
|||||||
/usr/include/c++/13/bits/random.tcc /usr/include/c++/13/numeric \
|
/usr/include/c++/13/bits/random.tcc /usr/include/c++/13/numeric \
|
||||||
/usr/include/c++/13/bits/stl_numeric.h \
|
/usr/include/c++/13/bits/stl_numeric.h \
|
||||||
/usr/include/c++/13/pstl/glue_numeric_defs.h \
|
/usr/include/c++/13/pstl/glue_numeric_defs.h \
|
||||||
/home/lj50/Univ/M2/Modelisation_problemes/simulation/src/Router.hpp
|
/home/lj50/Univ/M2/Modelisation_problemes/simulation/src/Router.hpp \
|
||||||
|
/home/lj50/Univ/M2/Modelisation_problemes/simulation/src/Sink.hpp
|
||||||
|
|||||||
57603
test/PoolRouter.csv
57603
test/PoolRouter.csv
File diff suppressed because it is too large
Load Diff
BIN
test/test_json
BIN
test/test_json
Binary file not shown.
BIN
test/test_simple
BIN
test/test_simple
Binary file not shown.
@@ -14,6 +14,7 @@
|
|||||||
#include "PoolRouter.hpp"
|
#include "PoolRouter.hpp"
|
||||||
#include "ProductionOrderGenerator.hpp"
|
#include "ProductionOrderGenerator.hpp"
|
||||||
#include "Router.hpp"
|
#include "Router.hpp"
|
||||||
|
#include "Sink.hpp"
|
||||||
|
|
||||||
using namespace std::chrono;
|
using namespace std::chrono;
|
||||||
|
|
||||||
@@ -21,7 +22,7 @@ class OnlyOnePoolGraphManager
|
|||||||
: public artis::pdevs::GraphManager<artis::common::DoubleTime, artis::common::NoParameters, artis::common::NoParameters> {
|
: public artis::pdevs::GraphManager<artis::common::DoubleTime, artis::common::NoParameters, artis::common::NoParameters> {
|
||||||
public:
|
public:
|
||||||
enum sub_models {
|
enum sub_models {
|
||||||
PROCESSOR_1, PROCESSOR_2, PROCESSOR_3, POOL_ROUTER, ROUTER, GENERATOR
|
PROCESSOR_1, PROCESSOR_2, PROCESSOR_3, POOL_ROUTER, ROUTER, GENERATOR, SINK
|
||||||
};
|
};
|
||||||
|
|
||||||
OnlyOnePoolGraphManager(artis::common::Coordinator<artis::common::DoubleTime> *coordinator,
|
OnlyOnePoolGraphManager(artis::common::Coordinator<artis::common::DoubleTime> *coordinator,
|
||||||
@@ -32,17 +33,19 @@ public:
|
|||||||
_generator("G",
|
_generator("G",
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
{0, {artis::factory::PoolMachineSequence(0, {0, 1, 2})}},
|
{0, {artis::factory::PoolMachineSequence(0, {0, 1, 2, 3})}},
|
||||||
{1, {artis::factory::PoolMachineSequence(0, {1, 2, 0})}},
|
{1, {artis::factory::PoolMachineSequence(0, {1, 2, 0, 3})}},
|
||||||
{2, {artis::factory::PoolMachineSequence(0, {2, 0, 1})}}
|
{2, {artis::factory::PoolMachineSequence(0, {2, 0, 1, 3})}}
|
||||||
},
|
},
|
||||||
62642, 15, 30
|
62642, 15, 30
|
||||||
}),
|
}),
|
||||||
_router("R", {1}),
|
_router("R", {1}),
|
||||||
_pool_router("P_R", {0, 3}),
|
_pool_router("P_R", {0, 4}),
|
||||||
_processor_1("M1", {{0, 0, 0}, 1, 10, 1}),
|
_processor_1("M1", {{0, 0, 0}, 1, 10, 1}),
|
||||||
_processor_2("M2", {{1, 0, 0}, 1, 8, 1}),
|
_processor_2("M2", {{1, 0, 0}, 1, 8, 1}),
|
||||||
_processor_3("M3", {{2, 0, 0}, 1, 15, 1}) {
|
_processor_3("M3", {{2, 0, 0}, 1, 15, 1}),
|
||||||
|
_sink("S", {3, 0}) {
|
||||||
|
this->add_child(SINK, &_sink);
|
||||||
this->add_child(PROCESSOR_1, &_processor_1);
|
this->add_child(PROCESSOR_1, &_processor_1);
|
||||||
this->add_child(PROCESSOR_2, &_processor_2);
|
this->add_child(PROCESSOR_2, &_processor_2);
|
||||||
this->add_child(PROCESSOR_3, &_processor_3);
|
this->add_child(PROCESSOR_3, &_processor_3);
|
||||||
@@ -76,6 +79,9 @@ public:
|
|||||||
|
|
||||||
out({&_processor_3, artis::factory::Processor::outputs::OUT})
|
out({&_processor_3, artis::factory::Processor::outputs::OUT})
|
||||||
>> in({&_pool_router, artis::factory::PoolRouter::inputs::IN_M + 2});
|
>> in({&_pool_router, artis::factory::PoolRouter::inputs::IN_M + 2});
|
||||||
|
|
||||||
|
out({&_router, artis::factory::Router::outputs::OUT/*_M+3*/}) // Sink
|
||||||
|
>> in({&_sink, artis::factory::Sink::inputs::IN});
|
||||||
}
|
}
|
||||||
|
|
||||||
~OnlyOnePoolGraphManager() override = default;
|
~OnlyOnePoolGraphManager() override = default;
|
||||||
@@ -87,6 +93,7 @@ private:
|
|||||||
artis::pdevs::Simulator<artis::common::DoubleTime, artis::factory::Processor, artis::factory::ProcessorParameters> _processor_1;
|
artis::pdevs::Simulator<artis::common::DoubleTime, artis::factory::Processor, artis::factory::ProcessorParameters> _processor_1;
|
||||||
artis::pdevs::Simulator<artis::common::DoubleTime, artis::factory::Processor, artis::factory::ProcessorParameters> _processor_2;
|
artis::pdevs::Simulator<artis::common::DoubleTime, artis::factory::Processor, artis::factory::ProcessorParameters> _processor_2;
|
||||||
artis::pdevs::Simulator<artis::common::DoubleTime, artis::factory::Processor, artis::factory::ProcessorParameters> _processor_3;
|
artis::pdevs::Simulator<artis::common::DoubleTime, artis::factory::Processor, artis::factory::ProcessorParameters> _processor_3;
|
||||||
|
artis::pdevs::Simulator<artis::common::DoubleTime, artis::factory::Sink, artis::factory::SinkParameters> _sink;
|
||||||
};
|
};
|
||||||
|
|
||||||
class PoolRouterView : public artis::factory::View {
|
class PoolRouterView : public artis::factory::View {
|
||||||
@@ -112,7 +119,9 @@ BOOST_AUTO_TEST_CASE(TestCase_OnePool)
|
|||||||
|
|
||||||
steady_clock::time_point t1 = steady_clock::now();
|
steady_clock::time_point t1 = steady_clock::now();
|
||||||
|
|
||||||
|
std::cout << "OK" << std::endl;
|
||||||
rc.run(context);
|
rc.run(context);
|
||||||
|
std::cout << "OK" << std::endl;
|
||||||
|
|
||||||
steady_clock::time_point t2 = steady_clock::now();
|
steady_clock::time_point t2 = steady_clock::now();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user