Ejemplo n.º 1
0
    void get_options(gauge::po::variables_map& options)
    {
        auto symbols = options["symbols"].as<std::vector<uint32_t> >();
        auto symbol_size = options["symbol_size"].as<std::vector<uint32_t> >();
        auto types = options["type"].as<std::vector<std::string> >();

        assert(symbols.size() > 0);
        assert(symbol_size.size() > 0);
        assert(types.size() > 0);

        for(uint32_t i = 0; i < symbols.size(); ++i)
        {
            for(uint32_t j = 0; j < symbol_size.size(); ++j)
            {
                for(uint32_t u = 0; u < types.size(); ++u)
                {
                    gauge::config_set cs;
                    cs.set_value<uint32_t>("symbols", symbols[i]);
                    cs.set_value<uint32_t>("symbol_size", symbol_size[j]);
                    cs.set_value<std::string>("type", types[u]);

                    add_configuration(cs);
                }
            }
        }
    }
Ejemplo n.º 2
0
    void get_options(gauge::po::variables_map& options)
    {
        auto symbols = options["symbols"].as<std::vector<uint32_t>>();
        auto loss_rate = options["loss_rate"].as<std::vector<double>>();
        auto symbol_size = options["symbol_size"].as<std::vector<uint32_t>>();
        auto types = options["type"].as<std::vector<std::string>>();

        assert(symbols.size() > 0);
        assert(loss_rate.size() > 0);
        assert(symbol_size.size() > 0);
        assert(types.size() > 0);

        for (const auto& s : symbols)
        {
            for (const auto& p : symbol_size)
            {
                for (const auto& r : loss_rate)
                {
                    for (const auto& t : types)
                    {
                        gauge::config_set cs;
                        cs.set_value<uint32_t>("symbols", s);
                        cs.set_value<uint32_t>("symbol_size", p);
                        cs.set_value<double>("loss_rate", r);
                        cs.set_value<std::string>("type", t);

                        uint32_t erased = (uint32_t)std::ceil(s * r);
                        cs.set_value<uint32_t>("erased_symbols", erased);

                        add_configuration(cs);
                    }
                }
            }
        }
    }
Ejemplo n.º 3
0
    void get_options(gauge::po::variables_map& options)
    {
        auto symbols = options["symbols"].as<std::vector<uint32_t> >();
        auto symbol_size = options["symbol_size"].as<std::vector<uint32_t> >();
        auto erasure = options["erasure"].as<std::vector<double> >();
        auto systematic = options["systematic"].as<bool>();

        assert(symbols.size() > 0);
        assert(symbol_size.size() > 0);
        assert(erasure.size() > 0);

        m_max_symbols = *std::max_element(symbols.begin(),
                                          symbols.end());

        m_max_symbol_size = *std::max_element(symbol_size.begin(),
                                              symbol_size.end());

        // Make the factories fit perfectly otherwise there seems to
        // be problems with memory access i.e. when using a factory
        // with max symbols 1024 with a symbols 16
        m_decoder_factory = std::make_shared<decoder_factory>(
            m_max_symbols, m_max_symbol_size);

        m_encoder_factory = std::make_shared<encoder_factory>(
            m_max_symbols, m_max_symbol_size);

        for(uint32_t i = 0; i < symbols.size(); ++i)
        {
            for(uint32_t j = 0; j < symbol_size.size(); ++j)
            {
                for(const auto& e : erasure)
                {
                    gauge::config_set cs;
                    cs.set_value<uint32_t>("symbols", symbols[i]);
                    cs.set_value<uint32_t>("symbol_size", symbol_size[j]);
                    cs.set_value<double>("erasure", e);
                    cs.set_value<bool>("systematic", systematic);
                    add_configuration(cs);
                }
            }
        }
    }
    void get_options(gauge::po::variables_map& options)
    {
        auto sizes = options["size"].as<std::vector<uint32_t>>();
        auto vectors = options["vectors"].as<std::vector<uint32_t>>();

        assert(sizes.size() > 0);
        assert(vectors.size() > 0);

        for (const auto& s : sizes)
        {
            for (const auto& v : vectors)
            {
                gauge::config_set cs;
                cs.set_value<uint32_t>("size", s);
                cs.set_value<uint32_t>("vectors", v);

                add_configuration(cs);
            }
        }
    }
Ejemplo n.º 5
0
    /// Get the options specified on the command-line and map this to a
    /// gauge::config which will be used by the simulator to run different
    /// configurations.
    void get_options(gauge::po::variables_map& options)
    {
        auto symbols =
            options["symbols"].as<uint32_t>();

        auto symbol_size =
            options["symbol_size"].as<uint32_t>();

        auto recode = options["recode"].as<bool>();

        gauge::config_set cs;
        cs.set_value<uint32_t>("symbols", symbols);
        cs.set_value<uint32_t>("symbol_size", symbol_size);
        cs.set_value<bool>("recode", recode);

        add_configuration(cs);

        m_factory = std::make_shared<factory_type>(
            symbols, symbol_size, m_generator);

    }