tasks_generator 1.1 → 1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/README.md +0 -28
- data/ext/tasks_generator/config.h +0 -22
- data/lib/tasks_generator/version.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,15 +1,15 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            !binary "U0hBMQ==":
         | 
| 3 3 | 
             
              metadata.gz: !binary |-
         | 
| 4 | 
            -
                 | 
| 4 | 
            +
                OTE2ZjE1Nzg2YTliNjE4ZDllOTQ0ZjMyMTRhMGUzNDVmMTBkOTgyYg==
         | 
| 5 5 | 
             
              data.tar.gz: !binary |-
         | 
| 6 | 
            -
                 | 
| 6 | 
            +
                MDQ1MjI5MGMwMDFlNTM1YzI0ZTJjZWY0ZDJlMTc0OGRhODM4NDA1Zg==
         | 
| 7 7 | 
             
            SHA512:
         | 
| 8 8 | 
             
              metadata.gz: !binary |-
         | 
| 9 | 
            -
                 | 
| 10 | 
            -
                 | 
| 11 | 
            -
                 | 
| 9 | 
            +
                YTA1M2IwZDA4OWIxODllODhkOGFkY2QzMWQxNTMxOGUyYTcwZGUzZjk3NDgy
         | 
| 10 | 
            +
                OWI4ODFhZDNjNTJhOGJhOGEyMWMzM2EyMTdkMjcxMWRiMmY2MGQzMTc3M2Vl
         | 
| 11 | 
            +
                YmRiN2M5NTg1NDQwNzUzOTU0ZWI4Zjc5OGI5ZjQ5MTY4ZmY1Mjc=
         | 
| 12 12 | 
             
              data.tar.gz: !binary |-
         | 
| 13 | 
            -
                 | 
| 14 | 
            -
                 | 
| 15 | 
            -
                 | 
| 13 | 
            +
                ZmYzOGZlOGE5MjhhMjZkZWIwNDY5YWQyYmI3Y2I2ZTAxOTU5NmY5MmE4NGIw
         | 
| 14 | 
            +
                NzJlNzQ0NWU4MDViMTg0MTQzOGM1YTUwYTVlMjJjNTg3NTZiODhmNGY1NWNj
         | 
| 15 | 
            +
                OWFjYTgyZjZiZDIxZTRhMmNlZmU2ZjFjYjk0ZjFhNDU4MThlYjE=
         | 
    
        data/README.md
    CHANGED
    
    | @@ -16,34 +16,6 @@ Or install it yourself as: | |
| 16 16 |  | 
| 17 17 | 
             
                $ gem install tasks_generator
         | 
| 18 18 |  | 
| 19 | 
            -
            ## Usage
         | 
| 20 | 
            -
             | 
| 21 | 
            -
            ### TasksGenerator::Config
         | 
| 22 | 
            -
            Config for configure Generator
         | 
| 23 | 
            -
            * life_time - iterations count for genetic algorithm (default: 1000)
         | 
| 24 | 
            -
            * mutation_chance - mutation chance (default: 0.05)
         | 
| 25 | 
            -
            * population_size - starting population (default: 1000)
         | 
| 26 | 
            -
            * tasks - tasks count
         | 
| 27 | 
            -
            * themes - array of Theme
         | 
| 28 | 
            -
             | 
| 29 | 
            -
            ### TasksGenerator::Theme
         | 
| 30 | 
            -
            Theme class for config.themes  
         | 
| 31 | 
            -
            * theme_id
         | 
| 32 | 
            -
            * difficulty_min
         | 
| 33 | 
            -
            * difficulty_max
         | 
| 34 | 
            -
             | 
| 35 | 
            -
            ### TasksGenerator::Question
         | 
| 36 | 
            -
            Question class for questions in Generator constructor
         | 
| 37 | 
            -
            * question_id
         | 
| 38 | 
            -
            * theme_id
         | 
| 39 | 
            -
            * difficulty
         | 
| 40 | 
            -
             | 
| 41 | 
            -
            ### TasksGenerator::Generator
         | 
| 42 | 
            -
            Test tasks generator
         | 
| 43 | 
            -
            * generate() - this method returns array of questions
         | 
| 44 | 
            -
             | 
| 45 | 
            -
            ## Contributing
         | 
| 46 | 
            -
             | 
| 47 19 | 
             
            1. Fork it ( https://github.com/Abitella/tasks_generator/fork )
         | 
| 48 20 | 
             
            2. Create your feature branch (`git checkout -b my-new-feature`)
         | 
| 49 21 | 
             
            3. Commit your changes (`git commit -am 'Add some feature'`)
         | 
| @@ -31,28 +31,6 @@ struct config_t { | |
| 31 31 | 
             
                  questions_count(q_count),
         | 
| 32 32 | 
             
                  topics() {
         | 
| 33 33 | 
             
              }
         | 
| 34 | 
            -
             | 
| 35 | 
            -
              config_t(std::unordered_map<std::string, std::string> const &map) noexcept :
         | 
| 36 | 
            -
                  config_t() {
         | 
| 37 | 
            -
                if (map.find("life-time") != map.end())
         | 
| 38 | 
            -
                  life_time = std::stoul(map.at("life-time"));
         | 
| 39 | 
            -
                if (map.find("population-size") != map.end())
         | 
| 40 | 
            -
                  population_size = std::stoul(map.at("population-size"));
         | 
| 41 | 
            -
                if (map.find("mutation-chance") != map.end())
         | 
| 42 | 
            -
                  mutation_chance = std::stod(map.at("mutation-chance"));
         | 
| 43 | 
            -
                if (map.find("log-enabled") != map.end())
         | 
| 44 | 
            -
                  log_enabled = true;
         | 
| 45 | 
            -
                if (map.find("variants-count") != map.end())
         | 
| 46 | 
            -
                  variants_count = std::stoul(map.at("variants-count"));
         | 
| 47 | 
            -
                if (map.find("questions-count") != map.end())
         | 
| 48 | 
            -
                  questions_count = std::stoul(map.at("questions-count"));
         | 
| 49 | 
            -
                if (map.find("stat-enabled") != map.end())
         | 
| 50 | 
            -
                  stat_enabled = true;
         | 
| 51 | 
            -
                if (map.find("mutation-duplicate-chance") != map.end())
         | 
| 52 | 
            -
                  mutation_duplicate_chance = std::stod(map.at("mutation-duplicate-chance"));
         | 
| 53 | 
            -
                if (map.find("try-generate") != map.end())
         | 
| 54 | 
            -
                  try_generate = std::stod(map.at("try-generate"));
         | 
| 55 | 
            -
              }
         | 
| 56 34 | 
             
            };
         | 
| 57 35 |  | 
| 58 36 | 
             
            std::ostream& operator << (std::ostream& out, config_t const &config) {
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: tasks_generator
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: '1. | 
| 4 | 
            +
              version: '1.2'
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Arslan Urtashev
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2014-12- | 
| 11 | 
            +
            date: 2014-12-27 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         |