binsymchan_sim.cpp
上传用户:jtjnyq9001
上传日期:2014-11-21
资源大小:3974k
文件大小:2k
- //
- // File = binsymchan_sim.cpp
- //
- #define SIM_NAME "BinSymChan "
- #define SIM_TITLE "Binary Symmetric Channel Testbed "
- #include "global_stuff.h"
- //=====================
- // model includes
- #include "bitgen.h"
- #include "siganchr.h"
- #include "bscerrorgen.h"
- #include "ber_ctr.h"
- //=========================================================
- main()
- {
- #include "sim_preamble.cpp"
- //=========================================================================
- // Misc special processing
- //=========================================================================
- // Allocate signals
- BIT_SIGNAL(bit_seq);
- BIT_SIGNAL(corrupt_seq);
- //============================================================
- // Construct, initialize and connect models
- BitGener* bit_gen = new BitGener( "bit_gen ",
- CommSystem,
- bit_seq );
-
- SignalAnchor* bit_seq_anchr = new SignalAnchor( "bit_seq_anchr ",
- CommSystem,
- bit_seq );
- BscErrorGener* err_gen = new BscErrorGener( "err_gen ",
- CommSystem,
- bit_seq,
- corrupt_seq );
-
- BerCounter* ber_ctr = new BerCounter( "ber_ctr ",
- CommSystem,
- bit_seq,
- corrupt_seq );
- //=============================================================
- #include "sim_postamble.cpp"
- return 0;
- }