Candidate_v1.7.0
        stable
      
      
        
          | Last change
 on this file since e9f307 was             0ad4781, checked in by Frederik Heber <frederik.heber@…>, 5 years ago | 
        
          | 
Added action to randomly select a set of atoms.
 needed to make new action friend of RandomNumberDistributionFactory to allow
setting of distribution parameters.
DOCU: added new selection action to userguide.
TESTS: added regression test cases, not working yet.
 | 
        
          | 
              
Property                 mode
 set to                 100644 | 
        
          | File size:
            1.2 KB | 
      
      
| Line |  | 
|---|
| 1 | /* | 
|---|
| 2 | * AtomByRandomAction.def | 
|---|
| 3 | * | 
|---|
| 4 | *  Created on: Sep 11, 2020 | 
|---|
| 5 | *      Author: heber | 
|---|
| 6 | */ | 
|---|
| 7 |  | 
|---|
| 8 | // all includes and forward declarations necessary for non-integral types below | 
|---|
| 9 | #include <vector> | 
|---|
| 10 | #include "types.hpp" | 
|---|
| 11 |  | 
|---|
| 12 | typedef std::vector<atomId_t> atomids_t; | 
|---|
| 13 |  | 
|---|
| 14 | #include "Parameters/Validators/DummyValidator.hpp" | 
|---|
| 15 |  | 
|---|
| 16 | // i.e. there is an integer with variable name Z that can be found in | 
|---|
| 17 | // ValueStorage by the token "Z" -> first column: int, Z, "Z" | 
|---|
| 18 | // "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value | 
|---|
| 19 | #define paramtypes (int) | 
|---|
| 20 | #define paramtokens ("select-atom-by-random") | 
|---|
| 21 | #define paramdescriptions ("number of distinct atom indices to select randomly") | 
|---|
| 22 | #define paramdefaults (1) | 
|---|
| 23 | #define paramreferences (number_requested) | 
|---|
| 24 | #define paramvalids \ | 
|---|
| 25 | (DummyValidator< int >()) | 
|---|
| 26 |  | 
|---|
| 27 | #define statetypes (atomids_t) | 
|---|
| 28 | #define statereferences (undoatomids) | 
|---|
| 29 |  | 
|---|
| 30 | // some defines for all the names, you may use ACTION, STATE and PARAMS | 
|---|
| 31 | #define CATEGORY Selection | 
|---|
| 32 | #define MENUNAME "selection" | 
|---|
| 33 | #define MENUPOSITION 7 | 
|---|
| 34 | #define ACTIONNAME AtomByRandom | 
|---|
| 35 | #define TOKEN "select-atom-by-random" | 
|---|
| 36 |  | 
|---|
| 37 |  | 
|---|
| 38 | // finally the information stored in the ActionTrait specialization | 
|---|
| 39 | #define DESCRIPTION "select a number of distinct atom(s) randomly" | 
|---|
| 40 | #undef SHORTFORM | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.