hillclimber 0.1.5a8__cp314-cp314-macosx_15_0_x86_64.whl
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.
- hillclimber/__init__.py +39 -0
- hillclimber/actions.py +53 -0
- hillclimber/analysis.py +590 -0
- hillclimber/biases.py +293 -0
- hillclimber/calc.py +22 -0
- hillclimber/cvs.py +1065 -0
- hillclimber/interfaces.py +133 -0
- hillclimber/metadynamics.py +325 -0
- hillclimber/nodes.py +6 -0
- hillclimber/opes.py +359 -0
- hillclimber/selectors.py +230 -0
- hillclimber/virtual_atoms.py +341 -0
- hillclimber-0.1.5a8.dist-info/METADATA +209 -0
- hillclimber-0.1.5a8.dist-info/RECORD +469 -0
- hillclimber-0.1.5a8.dist-info/WHEEL +6 -0
- hillclimber-0.1.5a8.dist-info/entry_points.txt +8 -0
- hillclimber-0.1.5a8.dist-info/licenses/LICENSE +165 -0
- plumed/__init__.py +104 -0
- plumed/_lib/bin/plumed +0 -0
- plumed/_lib/bin/plumed-config +9 -0
- plumed/_lib/bin/plumed-patch +9 -0
- plumed/_lib/include/plumed/adjmat/AdjacencyMatrixBase.h +659 -0
- plumed/_lib/include/plumed/adjmat/ContactMatrix.h +59 -0
- plumed/_lib/include/plumed/asmjit/arch.h +228 -0
- plumed/_lib/include/plumed/asmjit/arm.h +43 -0
- plumed/_lib/include/plumed/asmjit/asmjit.h +69 -0
- plumed/_lib/include/plumed/asmjit/asmjit_apibegin.h +143 -0
- plumed/_lib/include/plumed/asmjit/asmjit_apiend.h +93 -0
- plumed/_lib/include/plumed/asmjit/asmjit_build.h +971 -0
- plumed/_lib/include/plumed/asmjit/assembler.h +183 -0
- plumed/_lib/include/plumed/asmjit/base.h +56 -0
- plumed/_lib/include/plumed/asmjit/codebuilder.h +944 -0
- plumed/_lib/include/plumed/asmjit/codecompiler.h +767 -0
- plumed/_lib/include/plumed/asmjit/codeemitter.h +528 -0
- plumed/_lib/include/plumed/asmjit/codeholder.h +777 -0
- plumed/_lib/include/plumed/asmjit/constpool.h +286 -0
- plumed/_lib/include/plumed/asmjit/cpuinfo.h +402 -0
- plumed/_lib/include/plumed/asmjit/func.h +1327 -0
- plumed/_lib/include/plumed/asmjit/globals.h +370 -0
- plumed/_lib/include/plumed/asmjit/inst.h +137 -0
- plumed/_lib/include/plumed/asmjit/logging.h +317 -0
- plumed/_lib/include/plumed/asmjit/misc_p.h +103 -0
- plumed/_lib/include/plumed/asmjit/moved_string.h +318 -0
- plumed/_lib/include/plumed/asmjit/operand.h +1599 -0
- plumed/_lib/include/plumed/asmjit/osutils.h +207 -0
- plumed/_lib/include/plumed/asmjit/regalloc_p.h +597 -0
- plumed/_lib/include/plumed/asmjit/runtime.h +227 -0
- plumed/_lib/include/plumed/asmjit/simdtypes.h +1104 -0
- plumed/_lib/include/plumed/asmjit/utils.h +1387 -0
- plumed/_lib/include/plumed/asmjit/vmem.h +183 -0
- plumed/_lib/include/plumed/asmjit/x86.h +45 -0
- plumed/_lib/include/plumed/asmjit/x86assembler.h +125 -0
- plumed/_lib/include/plumed/asmjit/x86builder.h +117 -0
- plumed/_lib/include/plumed/asmjit/x86compiler.h +322 -0
- plumed/_lib/include/plumed/asmjit/x86emitter.h +5149 -0
- plumed/_lib/include/plumed/asmjit/x86globals.h +535 -0
- plumed/_lib/include/plumed/asmjit/x86inst.h +2547 -0
- plumed/_lib/include/plumed/asmjit/x86instimpl_p.h +74 -0
- plumed/_lib/include/plumed/asmjit/x86internal_p.h +108 -0
- plumed/_lib/include/plumed/asmjit/x86logging_p.h +92 -0
- plumed/_lib/include/plumed/asmjit/x86misc.h +417 -0
- plumed/_lib/include/plumed/asmjit/x86operand.h +1133 -0
- plumed/_lib/include/plumed/asmjit/x86regalloc_p.h +734 -0
- plumed/_lib/include/plumed/asmjit/zone.h +1157 -0
- plumed/_lib/include/plumed/bias/Bias.h +82 -0
- plumed/_lib/include/plumed/bias/ReweightBase.h +58 -0
- plumed/_lib/include/plumed/blas/blas.h +253 -0
- plumed/_lib/include/plumed/blas/def_external.h +61 -0
- plumed/_lib/include/plumed/blas/def_internal.h +97 -0
- plumed/_lib/include/plumed/blas/real.h +49 -0
- plumed/_lib/include/plumed/cltools/CLTool.h +32 -0
- plumed/_lib/include/plumed/clusters/ClusteringBase.h +70 -0
- plumed/_lib/include/plumed/colvar/Colvar.h +32 -0
- plumed/_lib/include/plumed/colvar/ColvarInput.h +68 -0
- plumed/_lib/include/plumed/colvar/ColvarShortcut.h +81 -0
- plumed/_lib/include/plumed/colvar/CoordinationBase.h +52 -0
- plumed/_lib/include/plumed/colvar/MultiColvarTemplate.h +333 -0
- plumed/_lib/include/plumed/colvar/PathMSDBase.h +101 -0
- plumed/_lib/include/plumed/colvar/RMSDVector.h +78 -0
- plumed/_lib/include/plumed/config/Config.h +118 -0
- plumed/_lib/include/plumed/config/version.h +9 -0
- plumed/_lib/include/plumed/contour/ContourFindingObject.h +87 -0
- plumed/_lib/include/plumed/contour/DistanceFromContourBase.h +82 -0
- plumed/_lib/include/plumed/contour/FindContour.h +67 -0
- plumed/_lib/include/plumed/core/Action.h +540 -0
- plumed/_lib/include/plumed/core/ActionAnyorder.h +48 -0
- plumed/_lib/include/plumed/core/ActionAtomistic.h +343 -0
- plumed/_lib/include/plumed/core/ActionForInterface.h +99 -0
- plumed/_lib/include/plumed/core/ActionPilot.h +57 -0
- plumed/_lib/include/plumed/core/ActionRegister.h +124 -0
- plumed/_lib/include/plumed/core/ActionSet.h +163 -0
- plumed/_lib/include/plumed/core/ActionSetup.h +48 -0
- plumed/_lib/include/plumed/core/ActionShortcut.h +73 -0
- plumed/_lib/include/plumed/core/ActionToGetData.h +59 -0
- plumed/_lib/include/plumed/core/ActionToPutData.h +101 -0
- plumed/_lib/include/plumed/core/ActionWithArguments.h +140 -0
- plumed/_lib/include/plumed/core/ActionWithMatrix.h +87 -0
- plumed/_lib/include/plumed/core/ActionWithValue.h +258 -0
- plumed/_lib/include/plumed/core/ActionWithVector.h +94 -0
- plumed/_lib/include/plumed/core/ActionWithVirtualAtom.h +123 -0
- plumed/_lib/include/plumed/core/CLTool.h +177 -0
- plumed/_lib/include/plumed/core/CLToolMain.h +102 -0
- plumed/_lib/include/plumed/core/CLToolRegister.h +108 -0
- plumed/_lib/include/plumed/core/Colvar.h +115 -0
- plumed/_lib/include/plumed/core/DataPassingObject.h +94 -0
- plumed/_lib/include/plumed/core/DataPassingTools.h +54 -0
- plumed/_lib/include/plumed/core/DomainDecomposition.h +120 -0
- plumed/_lib/include/plumed/core/ExchangePatterns.h +47 -0
- plumed/_lib/include/plumed/core/FlexibleBin.h +63 -0
- plumed/_lib/include/plumed/core/GREX.h +61 -0
- plumed/_lib/include/plumed/core/GenericMolInfo.h +89 -0
- plumed/_lib/include/plumed/core/Group.h +41 -0
- plumed/_lib/include/plumed/core/ModuleMap.h +30 -0
- plumed/_lib/include/plumed/core/ParallelTaskManager.h +1023 -0
- plumed/_lib/include/plumed/core/PbcAction.h +61 -0
- plumed/_lib/include/plumed/core/PlumedMain.h +632 -0
- plumed/_lib/include/plumed/core/PlumedMainInitializer.h +118 -0
- plumed/_lib/include/plumed/core/RegisterBase.h +340 -0
- plumed/_lib/include/plumed/core/TargetDist.h +48 -0
- plumed/_lib/include/plumed/core/Value.h +547 -0
- plumed/_lib/include/plumed/core/WithCmd.h +93 -0
- plumed/_lib/include/plumed/dimred/SMACOF.h +55 -0
- plumed/_lib/include/plumed/drr/DRR.h +383 -0
- plumed/_lib/include/plumed/drr/colvar_UIestimator.h +777 -0
- plumed/_lib/include/plumed/fisst/legendre_rule_fast.h +44 -0
- plumed/_lib/include/plumed/function/Custom.h +54 -0
- plumed/_lib/include/plumed/function/Function.h +85 -0
- plumed/_lib/include/plumed/function/FunctionOfMatrix.h +368 -0
- plumed/_lib/include/plumed/function/FunctionOfScalar.h +135 -0
- plumed/_lib/include/plumed/function/FunctionOfVector.h +296 -0
- plumed/_lib/include/plumed/function/FunctionSetup.h +180 -0
- plumed/_lib/include/plumed/function/FunctionShortcut.h +130 -0
- plumed/_lib/include/plumed/function/FunctionWithSingleArgument.h +165 -0
- plumed/_lib/include/plumed/gridtools/ActionWithGrid.h +43 -0
- plumed/_lib/include/plumed/gridtools/EvaluateGridFunction.h +99 -0
- plumed/_lib/include/plumed/gridtools/FunctionOfGrid.h +295 -0
- plumed/_lib/include/plumed/gridtools/GridCoordinatesObject.h +179 -0
- plumed/_lib/include/plumed/gridtools/GridSearch.h +135 -0
- plumed/_lib/include/plumed/gridtools/Interpolator.h +45 -0
- plumed/_lib/include/plumed/gridtools/KDE.h +455 -0
- plumed/_lib/include/plumed/gridtools/RDF.h +40 -0
- plumed/_lib/include/plumed/gridtools/SumOfKernels.h +219 -0
- plumed/_lib/include/plumed/isdb/MetainferenceBase.h +398 -0
- plumed/_lib/include/plumed/lapack/def_external.h +207 -0
- plumed/_lib/include/plumed/lapack/def_internal.h +388 -0
- plumed/_lib/include/plumed/lapack/lapack.h +899 -0
- plumed/_lib/include/plumed/lapack/lapack_limits.h +79 -0
- plumed/_lib/include/plumed/lapack/real.h +50 -0
- plumed/_lib/include/plumed/lepton/CompiledExpression.h +164 -0
- plumed/_lib/include/plumed/lepton/CustomFunction.h +143 -0
- plumed/_lib/include/plumed/lepton/Exception.h +93 -0
- plumed/_lib/include/plumed/lepton/ExpressionProgram.h +137 -0
- plumed/_lib/include/plumed/lepton/ExpressionTreeNode.h +145 -0
- plumed/_lib/include/plumed/lepton/Lepton.h +85 -0
- plumed/_lib/include/plumed/lepton/MSVC_erfc.h +123 -0
- plumed/_lib/include/plumed/lepton/Operation.h +1302 -0
- plumed/_lib/include/plumed/lepton/ParsedExpression.h +165 -0
- plumed/_lib/include/plumed/lepton/Parser.h +111 -0
- plumed/_lib/include/plumed/lepton/windowsIncludes.h +73 -0
- plumed/_lib/include/plumed/mapping/Path.h +44 -0
- plumed/_lib/include/plumed/mapping/PathProjectionCalculator.h +57 -0
- plumed/_lib/include/plumed/matrixtools/MatrixOperationBase.h +54 -0
- plumed/_lib/include/plumed/matrixtools/MatrixTimesMatrix.h +309 -0
- plumed/_lib/include/plumed/matrixtools/MatrixTimesVectorBase.h +365 -0
- plumed/_lib/include/plumed/matrixtools/OuterProduct.h +238 -0
- plumed/_lib/include/plumed/maze/Core.h +65 -0
- plumed/_lib/include/plumed/maze/Loss.h +86 -0
- plumed/_lib/include/plumed/maze/Member.h +66 -0
- plumed/_lib/include/plumed/maze/Memetic.h +799 -0
- plumed/_lib/include/plumed/maze/Optimizer.h +357 -0
- plumed/_lib/include/plumed/maze/Random_MT.h +156 -0
- plumed/_lib/include/plumed/maze/Tools.h +183 -0
- plumed/_lib/include/plumed/metatomic/vesin.h +188 -0
- plumed/_lib/include/plumed/molfile/Gromacs.h +2013 -0
- plumed/_lib/include/plumed/molfile/endianswap.h +217 -0
- plumed/_lib/include/plumed/molfile/fastio.h +683 -0
- plumed/_lib/include/plumed/molfile/largefiles.h +78 -0
- plumed/_lib/include/plumed/molfile/libmolfile_plugin.h +77 -0
- plumed/_lib/include/plumed/molfile/molfile_plugin.h +1034 -0
- plumed/_lib/include/plumed/molfile/periodic_table.h +248 -0
- plumed/_lib/include/plumed/molfile/readpdb.h +447 -0
- plumed/_lib/include/plumed/molfile/vmdplugin.h +236 -0
- plumed/_lib/include/plumed/multicolvar/MultiColvarShortcuts.h +45 -0
- plumed/_lib/include/plumed/opes/ExpansionCVs.h +79 -0
- plumed/_lib/include/plumed/sasa/Sasa.h +32 -0
- plumed/_lib/include/plumed/secondarystructure/SecondaryStructureBase.h +372 -0
- plumed/_lib/include/plumed/setup/ActionSetup.h +25 -0
- plumed/_lib/include/plumed/small_vector/small_vector.h +6114 -0
- plumed/_lib/include/plumed/symfunc/CoordinationNumbers.h +41 -0
- plumed/_lib/include/plumed/tools/Angle.h +52 -0
- plumed/_lib/include/plumed/tools/AtomDistribution.h +138 -0
- plumed/_lib/include/plumed/tools/AtomNumber.h +152 -0
- plumed/_lib/include/plumed/tools/BiasRepresentation.h +106 -0
- plumed/_lib/include/plumed/tools/BitmaskEnum.h +167 -0
- plumed/_lib/include/plumed/tools/Brent1DRootSearch.h +159 -0
- plumed/_lib/include/plumed/tools/CheckInRange.h +44 -0
- plumed/_lib/include/plumed/tools/Citations.h +74 -0
- plumed/_lib/include/plumed/tools/ColvarOutput.h +118 -0
- plumed/_lib/include/plumed/tools/Communicator.h +316 -0
- plumed/_lib/include/plumed/tools/ConjugateGradient.h +80 -0
- plumed/_lib/include/plumed/tools/DLLoader.h +79 -0
- plumed/_lib/include/plumed/tools/ERMSD.h +73 -0
- plumed/_lib/include/plumed/tools/Exception.h +406 -0
- plumed/_lib/include/plumed/tools/File.h +28 -0
- plumed/_lib/include/plumed/tools/FileBase.h +153 -0
- plumed/_lib/include/plumed/tools/FileTools.h +37 -0
- plumed/_lib/include/plumed/tools/ForwardDecl.h +54 -0
- plumed/_lib/include/plumed/tools/Grid.h +638 -0
- plumed/_lib/include/plumed/tools/HistogramBead.h +136 -0
- plumed/_lib/include/plumed/tools/IFile.h +117 -0
- plumed/_lib/include/plumed/tools/KernelFunctions.h +113 -0
- plumed/_lib/include/plumed/tools/Keywords.h +380 -0
- plumed/_lib/include/plumed/tools/LatticeReduction.h +66 -0
- plumed/_lib/include/plumed/tools/LeptonCall.h +64 -0
- plumed/_lib/include/plumed/tools/LinkCells.h +126 -0
- plumed/_lib/include/plumed/tools/Log.h +41 -0
- plumed/_lib/include/plumed/tools/LoopUnroller.h +163 -0
- plumed/_lib/include/plumed/tools/Matrix.h +721 -0
- plumed/_lib/include/plumed/tools/MatrixSquareBracketsAccess.h +138 -0
- plumed/_lib/include/plumed/tools/MergeVectorTools.h +153 -0
- plumed/_lib/include/plumed/tools/Minimise1DBrent.h +244 -0
- plumed/_lib/include/plumed/tools/MinimiseBase.h +120 -0
- plumed/_lib/include/plumed/tools/MolDataClass.h +51 -0
- plumed/_lib/include/plumed/tools/NeighborList.h +112 -0
- plumed/_lib/include/plumed/tools/OFile.h +286 -0
- plumed/_lib/include/plumed/tools/OpenACC.h +180 -0
- plumed/_lib/include/plumed/tools/OpenMP.h +75 -0
- plumed/_lib/include/plumed/tools/PDB.h +154 -0
- plumed/_lib/include/plumed/tools/Pbc.h +139 -0
- plumed/_lib/include/plumed/tools/PlumedHandle.h +105 -0
- plumed/_lib/include/plumed/tools/RMSD.h +493 -0
- plumed/_lib/include/plumed/tools/Random.h +80 -0
- plumed/_lib/include/plumed/tools/RootFindingBase.h +79 -0
- plumed/_lib/include/plumed/tools/Stopwatch.h +475 -0
- plumed/_lib/include/plumed/tools/Subprocess.h +142 -0
- plumed/_lib/include/plumed/tools/SwitchingFunction.h +208 -0
- plumed/_lib/include/plumed/tools/Tensor.h +724 -0
- plumed/_lib/include/plumed/tools/TokenizedLine.h +123 -0
- plumed/_lib/include/plumed/tools/Tools.h +638 -0
- plumed/_lib/include/plumed/tools/Torsion.h +55 -0
- plumed/_lib/include/plumed/tools/TrajectoryParser.h +118 -0
- plumed/_lib/include/plumed/tools/Tree.h +61 -0
- plumed/_lib/include/plumed/tools/TypesafePtr.h +463 -0
- plumed/_lib/include/plumed/tools/Units.h +167 -0
- plumed/_lib/include/plumed/tools/Vector.h +433 -0
- plumed/_lib/include/plumed/tools/View.h +296 -0
- plumed/_lib/include/plumed/tools/View2D.h +100 -0
- plumed/_lib/include/plumed/tools/h36.h +39 -0
- plumed/_lib/include/plumed/vatom/ActionWithVirtualAtom.h +32 -0
- plumed/_lib/include/plumed/ves/BasisFunctions.h +380 -0
- plumed/_lib/include/plumed/ves/CoeffsBase.h +310 -0
- plumed/_lib/include/plumed/ves/CoeffsMatrix.h +220 -0
- plumed/_lib/include/plumed/ves/CoeffsVector.h +251 -0
- plumed/_lib/include/plumed/ves/FermiSwitchingFunction.h +74 -0
- plumed/_lib/include/plumed/ves/GridIntegrationWeights.h +50 -0
- plumed/_lib/include/plumed/ves/GridLinearInterpolation.h +81 -0
- plumed/_lib/include/plumed/ves/GridProjWeights.h +61 -0
- plumed/_lib/include/plumed/ves/LinearBasisSetExpansion.h +303 -0
- plumed/_lib/include/plumed/ves/Optimizer.h +444 -0
- plumed/_lib/include/plumed/ves/TargetDistModifer.h +53 -0
- plumed/_lib/include/plumed/ves/TargetDistribution.h +266 -0
- plumed/_lib/include/plumed/ves/VesBias.h +545 -0
- plumed/_lib/include/plumed/ves/VesTools.h +142 -0
- plumed/_lib/include/plumed/ves/WaveletGrid.h +75 -0
- plumed/_lib/include/plumed/volumes/ActionVolume.h +268 -0
- plumed/_lib/include/plumed/volumes/VolumeShortcut.h +147 -0
- plumed/_lib/include/plumed/wrapper/Plumed.h +5025 -0
- plumed/_lib/include/plumed/xdrfile/xdrfile.h +663 -0
- plumed/_lib/include/plumed/xdrfile/xdrfile_trr.h +89 -0
- plumed/_lib/include/plumed/xdrfile/xdrfile_xtc.h +90 -0
- plumed/_lib/lib/PythonCVInterface.dylib +0 -0
- plumed/_lib/lib/libplumed.dylib +0 -0
- plumed/_lib/lib/libplumedKernel.dylib +0 -0
- plumed/_lib/lib/libplumedWrapper.a +0 -0
- plumed/_lib/lib/pkgconfig/plumed.pc +13 -0
- plumed/_lib/lib/pkgconfig/plumedInternals.pc +13 -0
- plumed/_lib/lib/pkgconfig/plumedWrapper.pc +13 -0
- plumed/_lib/lib/plumed/fortran/plumed.f90 +879 -0
- plumed/_lib/lib/plumed/fortran/plumed_f08.f90 +2625 -0
- plumed/_lib/lib/plumed/modulefile +69 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.config +43 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/CMakeLists.txt +543 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/CMakeLists.txt.preplumed +540 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/expanded.cpp +1628 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/expanded.cpp.preplumed +1590 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/expanded.h +103 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/expanded.h.preplumed +99 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/sim_util.cpp +2527 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdlib/sim_util.cpp.preplumed +2513 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/legacymdrunoptions.cpp +208 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/legacymdrunoptions.cpp.preplumed +175 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/legacymdrunoptions.h +408 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/legacymdrunoptions.h.preplumed +394 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/md.cpp +2348 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/md.cpp.preplumed +2091 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/minimize.cpp +3573 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/minimize.cpp.preplumed +3495 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/replicaexchange.cpp +1506 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/replicaexchange.cpp.preplumed +1402 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/replicaexchange.h +114 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/replicaexchange.h.preplumed +106 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/rerun.cpp +997 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/rerun.cpp.preplumed +906 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/runner.cpp +2780 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/mdrun/runner.cpp.preplumed +2738 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp +224 -0
- plumed/_lib/lib/plumed/patches/gromacs-2022.5.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp.preplumed +222 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.config +43 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/CMakeLists.txt +549 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/CMakeLists.txt.preplumed +546 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/expanded.cpp +1632 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/expanded.cpp.preplumed +1594 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/expanded.h +104 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/expanded.h.preplumed +100 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/sim_util.cpp +2624 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdlib/sim_util.cpp.preplumed +2610 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/legacymdrunoptions.cpp +208 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/legacymdrunoptions.cpp.preplumed +175 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/legacymdrunoptions.h +409 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/legacymdrunoptions.h.preplumed +395 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/md.cpp +2419 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/md.cpp.preplumed +2164 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/minimize.cpp +3546 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/minimize.cpp.preplumed +3468 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/replicaexchange.cpp +1513 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/replicaexchange.cpp.preplumed +1409 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/replicaexchange.h +114 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/replicaexchange.h.preplumed +106 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/rerun.cpp +991 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/rerun.cpp.preplumed +900 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/runner.cpp +2895 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/mdrun/runner.cpp.preplumed +2849 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp +224 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp.preplumed +222 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/taskassignment/decidegpuusage.cpp +886 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/taskassignment/decidegpuusage.cpp.preplumed +880 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/taskassignment/include/gromacs/taskassignment/decidegpuusage.h +347 -0
- plumed/_lib/lib/plumed/patches/gromacs-2023.5.diff/src/gromacs/taskassignment/include/gromacs/taskassignment/decidegpuusage.h.preplumed +345 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.config +43 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/CMakeLists.txt +575 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/CMakeLists.txt.preplumed +572 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/expanded.cpp +1632 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/expanded.cpp.preplumed +1594 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/expanded.h +104 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/expanded.h.preplumed +100 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/sim_util.cpp +2564 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdlib/sim_util.cpp.preplumed +2550 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/legacymdrunoptions.cpp +208 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/legacymdrunoptions.cpp.preplumed +175 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/legacymdrunoptions.h +410 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/legacymdrunoptions.h.preplumed +396 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/md.cpp +2435 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/md.cpp.preplumed +2187 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/minimize.cpp +3592 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/minimize.cpp.preplumed +3514 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/replicaexchange.cpp +1513 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/replicaexchange.cpp.preplumed +1409 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/replicaexchange.h +114 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/replicaexchange.h.preplumed +106 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/rerun.cpp +958 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/rerun.cpp.preplumed +929 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/runner.cpp +2987 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/mdrun/runner.cpp.preplumed +2941 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp +224 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/modularsimulator/expandedensembleelement.cpp.preplumed +222 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/taskassignment/decidegpuusage.cpp +904 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/taskassignment/decidegpuusage.cpp.preplumed +898 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/taskassignment/include/gromacs/taskassignment/decidegpuusage.h +353 -0
- plumed/_lib/lib/plumed/patches/gromacs-2024.3.diff/src/gromacs/taskassignment/include/gromacs/taskassignment/decidegpuusage.h.preplumed +351 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.config +39 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/cmake/gmxManagePlumed.cmake +82 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/cmake/gmxManagePlumed.cmake.preplumed +82 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedMDModule.cpp +162 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedMDModule.cpp.preplumed +154 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedOptions.cpp +107 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedOptions.cpp.preplumed +99 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedOptions.h +120 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedOptions.h.preplumed +111 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedforceprovider.cpp +215 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedforceprovider.cpp.preplumed +197 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedforceprovider.h +87 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/applied_forces/plumed/plumedforceprovider.h.preplumed +86 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/mdrun/runner.cpp +2971 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/mdrun/runner.cpp.preplumed +2970 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/mdrunutility/mdmodulesnotifiers.h +430 -0
- plumed/_lib/lib/plumed/patches/gromacs-2025.0.diff/src/gromacs/mdrunutility/mdmodulesnotifiers.h.preplumed +429 -0
- plumed/_lib/lib/plumed/patches/namd-2.12.config +30 -0
- plumed/_lib/lib/plumed/patches/namd-2.12.diff +267 -0
- plumed/_lib/lib/plumed/patches/namd-2.13.config +30 -0
- plumed/_lib/lib/plumed/patches/namd-2.13.diff +267 -0
- plumed/_lib/lib/plumed/patches/namd-2.14.config +30 -0
- plumed/_lib/lib/plumed/patches/namd-2.14.diff +268 -0
- plumed/_lib/lib/plumed/patches/patch.sh +500 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.config +25 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/forces.f90 +368 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/forces.f90.preplumed +366 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/plugin_forces.f90 +71 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/plugin_forces.f90.preplumed +24 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/plugin_initialization.f90 +62 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/plugin_initialization.f90.preplumed +21 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/pwscf.f90 +189 -0
- plumed/_lib/lib/plumed/patches/qespresso-5.0.2.diff/PW/src/pwscf.f90.preplumed +185 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.config +26 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/forces.f90 +422 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/forces.f90.preplumed +420 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/plugin_ext_forces.f90 +70 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/plugin_ext_forces.f90.preplumed +23 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/plugin_initialization.f90 +62 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/plugin_initialization.f90.preplumed +21 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/run_pwscf.f90 +233 -0
- plumed/_lib/lib/plumed/patches/qespresso-6.2.diff/PW/src/run_pwscf.f90.preplumed +230 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.config +28 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/Modules/Makefile +175 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/Modules/Makefile.preplumed +171 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/forces.f90 +486 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/forces.f90.preplumed +484 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/plugin_ext_forces.f90 +74 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/plugin_ext_forces.f90.preplumed +23 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/plugin_initialization.f90 +64 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/plugin_initialization.f90.preplumed +21 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/run_pwscf.f90 +532 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.0.diff/PW/src/run_pwscf.f90.preplumed +518 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.config +28 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/Modules/Makefile +249 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/Modules/Makefile.preplumed +244 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/forces.f90 +532 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/forces.f90.preplumed +535 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/plugin_ext_forces.f90 +74 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/plugin_ext_forces.f90.preplumed +23 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/plugin_initialization.f90 +64 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/plugin_initialization.f90.preplumed +21 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/run_pwscf.f90 +569 -0
- plumed/_lib/lib/plumed/patches/qespresso-7.2.diff/PW/src/run_pwscf.f90.preplumed +560 -0
- plumed/_lib/lib/plumed/plumed-config +9 -0
- plumed/_lib/lib/plumed/plumed-mklib +9 -0
- plumed/_lib/lib/plumed/plumed-newcv +9 -0
- plumed/_lib/lib/plumed/plumed-partial_tempering +9 -0
- plumed/_lib/lib/plumed/plumed-patch +9 -0
- plumed/_lib/lib/plumed/plumed-runtime +0 -0
- plumed/_lib/lib/plumed/plumed-selector +9 -0
- plumed/_lib/lib/plumed/plumed-vim2html +9 -0
- plumed/_lib/lib/plumed/scripts/config.sh +126 -0
- plumed/_lib/lib/plumed/scripts/mklib.sh +175 -0
- plumed/_lib/lib/plumed/scripts/newcv.sh +26 -0
- plumed/_lib/lib/plumed/scripts/partial_tempering.sh +319 -0
- plumed/_lib/lib/plumed/scripts/patch.sh +4 -0
- plumed/_lib/lib/plumed/scripts/selector.sh +234 -0
- plumed/_lib/lib/plumed/scripts/vim2html.sh +190 -0
- plumed/_lib/lib/plumed/src/colvar/Template.cpp +116 -0
- plumed/_lib/lib/plumed/src/config/compile_options.sh +3 -0
- plumed/_lib/lib/plumed/src/config/config.txt +181 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.cmake +6 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.cmake.runtime +5 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.cmake.shared +5 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.cmake.static +3 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.inc +6 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.inc.runtime +5 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.inc.shared +5 -0
- plumed/_lib/lib/plumed/src/lib/Plumed.inc.static +3 -0
- plumed/_lib/lib/plumed/vim/scripts.vim +6 -0
- plumed/_plumed_core.cpython-311-darwin.so +0 -0
- plumed/_plumed_core.cpython-312-darwin.so +0 -0
- plumed/_plumed_core.cpython-313-darwin.so +0 -0
- plumed/_plumed_core.cpython-314-darwin.so +0 -0
- plumedCommunications.cpython-311-darwin.so +0 -0
- plumedCommunications.cpython-312-darwin.so +0 -0
- plumedCommunications.cpython-313-darwin.so +0 -0
- plumedCommunications.cpython-314-darwin.so +0 -0
- plumedCommunications.pyi +431 -0
|
@@ -0,0 +1,799 @@
|
|
|
1
|
+
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
2
|
+
Copyright (c) 2019 Jakub Rydzewski (jr@fizyka.umk.pl). All rights reserved.
|
|
3
|
+
|
|
4
|
+
See http://www.maze-code.github.io for more information.
|
|
5
|
+
|
|
6
|
+
This file is part of maze.
|
|
7
|
+
|
|
8
|
+
maze is free software: you can redistribute it and/or modify it under the
|
|
9
|
+
terms of the GNU Lesser General Public License as published by the Free
|
|
10
|
+
Software Foundation, either version 3 of the License, or (at your option)
|
|
11
|
+
any later version.
|
|
12
|
+
|
|
13
|
+
maze is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
14
|
+
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
15
|
+
FOR A PARTICULAR PURPOSE.
|
|
16
|
+
|
|
17
|
+
See the GNU Lesser General Public License for more details.
|
|
18
|
+
|
|
19
|
+
You should have received a copy of the GNU Lesser General Public License
|
|
20
|
+
along with maze. If not, see <https://www.gnu.org/licenses/>.
|
|
21
|
+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
|
|
22
|
+
#ifndef __PLUMED_maze_Memetic_h
|
|
23
|
+
#define __PLUMED_maze_Memetic_h
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @file Memetic.h
|
|
27
|
+
*
|
|
28
|
+
* @author J. Rydzewski (jr@fizyka.umk.pl)
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
#include "../core/ActionRegister.h"
|
|
32
|
+
|
|
33
|
+
#include "Core.h"
|
|
34
|
+
#include "Member.h"
|
|
35
|
+
#include "Optimizer.h"
|
|
36
|
+
|
|
37
|
+
namespace PLMD {
|
|
38
|
+
namespace maze {
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @class Memetic Memetic.h "maze/Memetic.h"
|
|
42
|
+
*
|
|
43
|
+
* @brief Memetic algorithms for the optimization of the loss function.
|
|
44
|
+
*/
|
|
45
|
+
class Memetic: public Optimizer {
|
|
46
|
+
public:
|
|
47
|
+
/**
|
|
48
|
+
* PLMD constructor.
|
|
49
|
+
*
|
|
50
|
+
* @param[in] ao PLMD::ActionOptions&.
|
|
51
|
+
*/
|
|
52
|
+
explicit Memetic(const ActionOptions& ao);
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Registers PLMD keywords.
|
|
56
|
+
*
|
|
57
|
+
* @param[in] keys Keywords.
|
|
58
|
+
*/
|
|
59
|
+
static void registerKeywords(Keywords& keys);
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Each class deriving from Optimizer needs to override this function.
|
|
63
|
+
*/
|
|
64
|
+
void optimize() override;
|
|
65
|
+
|
|
66
|
+
private:
|
|
67
|
+
/**
|
|
68
|
+
* Create a set of translations relative to the ligand, each translation
|
|
69
|
+
* encodes a probable biasing direction.
|
|
70
|
+
*/
|
|
71
|
+
void initialize_members();
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Score each translation by the loss function.
|
|
75
|
+
*/
|
|
76
|
+
void score_members();
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Calculate the mean score.
|
|
80
|
+
*/
|
|
81
|
+
double score_mean();
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Sort the population using heaps, required for finding a minimum of the loss
|
|
85
|
+
* function.
|
|
86
|
+
*/
|
|
87
|
+
void sort_members();
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Encode a ligand conformation.
|
|
91
|
+
*/
|
|
92
|
+
Vector create_coding();
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Check if the vector length is out of bounds.
|
|
96
|
+
*
|
|
97
|
+
* @param[in] v Vector length.
|
|
98
|
+
*/
|
|
99
|
+
bool out_of_bounds(double v);
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Score a single member.
|
|
103
|
+
*
|
|
104
|
+
* @param[in] v Member's translation.
|
|
105
|
+
*/
|
|
106
|
+
double score_member(const Vector& v);
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Print a status.
|
|
110
|
+
*/
|
|
111
|
+
void print_status() const;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Select a new population using the roulette selection.
|
|
115
|
+
*/
|
|
116
|
+
void selection_roulette();
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Perform mating in the population.
|
|
120
|
+
*
|
|
121
|
+
* @param[in,out] members Population.
|
|
122
|
+
*/
|
|
123
|
+
void mating(std::vector<Member>& members);
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Mate two members.
|
|
127
|
+
*
|
|
128
|
+
* @param[in,out] m1 1st member.
|
|
129
|
+
* @param[in,out] m2 2nd member.
|
|
130
|
+
*/
|
|
131
|
+
void crossover(Member& m1, Member& m2);
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Mutate a member.
|
|
135
|
+
*
|
|
136
|
+
* @param[in,out] m Member.
|
|
137
|
+
*/
|
|
138
|
+
void mutation(Member& m);
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Mutate the population.
|
|
142
|
+
*
|
|
143
|
+
* @param[in,out] members Population.
|
|
144
|
+
*/
|
|
145
|
+
void mutation(std::vector<Member>& members);
|
|
146
|
+
|
|
147
|
+
protected:
|
|
148
|
+
/**
|
|
149
|
+
* Local searches to improve global solutions.
|
|
150
|
+
*/
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Stochastic hill climbing.
|
|
154
|
+
*
|
|
155
|
+
* Neighbors with better or equal cost should be accepted, allowing the
|
|
156
|
+
* technique to navigate across plateaus in the response surface.
|
|
157
|
+
*
|
|
158
|
+
* @param[in,out] m Member.
|
|
159
|
+
* @param[in] params None.
|
|
160
|
+
*/
|
|
161
|
+
void stochastic_hill_climbing(
|
|
162
|
+
Member& m,
|
|
163
|
+
/* none */ const std::vector<double>& params = {}
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Random-restart hill climbing.
|
|
168
|
+
*
|
|
169
|
+
* The algorithm can be restarted and repeated a number of times after it
|
|
170
|
+
* converges to provide an improved result.
|
|
171
|
+
*
|
|
172
|
+
* @param[in,out] m Member.
|
|
173
|
+
* @param[in] params Number of restarts.
|
|
174
|
+
*/
|
|
175
|
+
void random_restart_hill_climbing(
|
|
176
|
+
Member& m,
|
|
177
|
+
/* n_restarts */ const std::vector<double>& params = {10}
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Solis-Wets random walk.
|
|
182
|
+
*
|
|
183
|
+
* Adaptive random search algorithm was designed to address the limitations of
|
|
184
|
+
* the fixed step size. The strategy for adaptive random search is to
|
|
185
|
+
* continually approximate the optimal step size required to reach the global
|
|
186
|
+
* optimum in the search space. This is achieved by trialling and adopting
|
|
187
|
+
* smaller or larger step sizes only if they result in an improvement in the
|
|
188
|
+
* search performance.
|
|
189
|
+
*
|
|
190
|
+
* Very large step sizes are trialled with a much lower frequency. This
|
|
191
|
+
* strategy of preferring large moves is intended to allow the technique to
|
|
192
|
+
* escape local optima. Smaller step sizes are adopted if no improvement is
|
|
193
|
+
* made for an extended period.
|
|
194
|
+
*
|
|
195
|
+
* @param[in,out] m Member.
|
|
196
|
+
* @param[in] params
|
|
197
|
+
*/
|
|
198
|
+
void adaptive_random_search(
|
|
199
|
+
Member& m,
|
|
200
|
+
/* */ const std::vector<double>& params = {1.0, 1.e-5, 2.0, 2.0, 3.0, 3.0}
|
|
201
|
+
);
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Luus–Jaakola heuristics.
|
|
205
|
+
*
|
|
206
|
+
* @param[in,out] m Member.
|
|
207
|
+
* @param[in] params Bounds.
|
|
208
|
+
*/
|
|
209
|
+
void luus_jaakola(
|
|
210
|
+
Member& m,
|
|
211
|
+
/* bounds */ const std::vector<double>& params
|
|
212
|
+
);
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Local annealing.
|
|
216
|
+
*
|
|
217
|
+
* @param[in,out] m Member.
|
|
218
|
+
* @param[in] params T, alpha.
|
|
219
|
+
*/
|
|
220
|
+
void annealing(
|
|
221
|
+
Member& m,
|
|
222
|
+
/* T, alpha */const std::vector<double>& params = {300.0, 0.95}
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Apply local search to members.
|
|
227
|
+
*
|
|
228
|
+
* @param[in,out] members Population.
|
|
229
|
+
*/
|
|
230
|
+
void local_search(std::vector<Member>& members);
|
|
231
|
+
|
|
232
|
+
protected:
|
|
233
|
+
/**
|
|
234
|
+
* Return an optimal biasing direction.
|
|
235
|
+
*/
|
|
236
|
+
Vector solve();
|
|
237
|
+
|
|
238
|
+
public:
|
|
239
|
+
/**
|
|
240
|
+
* Setters and getters.
|
|
241
|
+
*/
|
|
242
|
+
|
|
243
|
+
unsigned int get_capacity() const;
|
|
244
|
+
void set_capacity(unsigned int);
|
|
245
|
+
|
|
246
|
+
unsigned int get_coding_len() const;
|
|
247
|
+
void set_coding_len(unsigned int);
|
|
248
|
+
|
|
249
|
+
unsigned int get_n_local_iterations() const;
|
|
250
|
+
void set_n_local_iterations(unsigned int);
|
|
251
|
+
|
|
252
|
+
unsigned int get_n_global_iterations() const;
|
|
253
|
+
void set_n_global_iterations(unsigned int);
|
|
254
|
+
|
|
255
|
+
double get_mutation_rate() const;
|
|
256
|
+
void set_mutation_rate(double);
|
|
257
|
+
|
|
258
|
+
double get_mating_rate() const;
|
|
259
|
+
void set_mating_rate(double);
|
|
260
|
+
|
|
261
|
+
double get_cauchy_mean() const;
|
|
262
|
+
void set_cauchy_mean(double);
|
|
263
|
+
|
|
264
|
+
double get_cauchy_spread() const;
|
|
265
|
+
void set_cauchy_spread(double);
|
|
266
|
+
|
|
267
|
+
bool is_local_search_on() const;
|
|
268
|
+
void local_search_on();
|
|
269
|
+
void local_search_off();
|
|
270
|
+
|
|
271
|
+
double get_local_search_rate() const;
|
|
272
|
+
void set_local_search_rate(double);
|
|
273
|
+
|
|
274
|
+
std::string get_local_search_type() const;
|
|
275
|
+
void set_local_search_type(const std::string&);
|
|
276
|
+
|
|
277
|
+
protected:
|
|
278
|
+
//! Population
|
|
279
|
+
std::vector<Member> members_;
|
|
280
|
+
|
|
281
|
+
//! Bound
|
|
282
|
+
double bound_;
|
|
283
|
+
|
|
284
|
+
//! Scores
|
|
285
|
+
double score_worst_;
|
|
286
|
+
double score_best_;
|
|
287
|
+
Member member_best_;
|
|
288
|
+
|
|
289
|
+
//! If a local search is performed
|
|
290
|
+
bool adaptation_;
|
|
291
|
+
|
|
292
|
+
protected:
|
|
293
|
+
//! Size of population
|
|
294
|
+
unsigned int capacity_;
|
|
295
|
+
//! Length of coding
|
|
296
|
+
unsigned int coding_len_;
|
|
297
|
+
|
|
298
|
+
//! Number of local search iterations
|
|
299
|
+
unsigned int n_local_iterations_;
|
|
300
|
+
//! Number of global search iterations, doomsday
|
|
301
|
+
unsigned int n_global_iterations_;
|
|
302
|
+
|
|
303
|
+
//! Probability of mutation
|
|
304
|
+
double mutation_rate_;
|
|
305
|
+
//! Probability of mating
|
|
306
|
+
double mating_rate_;
|
|
307
|
+
|
|
308
|
+
//! Mean and spread of cauchy sampler
|
|
309
|
+
double cauchy_mean_alpha_;
|
|
310
|
+
double cauchy_mean_beta_;
|
|
311
|
+
|
|
312
|
+
//! If local search is employed in sampling
|
|
313
|
+
bool local_search_on_;
|
|
314
|
+
//! Rate of local mutation
|
|
315
|
+
double local_search_rate_;
|
|
316
|
+
//! Type of local search, stochastic_hill_climbing or adaptive_random_search
|
|
317
|
+
std::string local_search_type_;
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
void Memetic::initialize_members() {
|
|
321
|
+
members_.clear();
|
|
322
|
+
members_.resize(capacity_);
|
|
323
|
+
|
|
324
|
+
for (size_t i = 0; i < capacity_; ++i) {
|
|
325
|
+
Member m{};
|
|
326
|
+
|
|
327
|
+
m.score=0;
|
|
328
|
+
m.translation=create_coding();
|
|
329
|
+
|
|
330
|
+
members_.at(i) = m;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
void Memetic::score_members() {
|
|
335
|
+
for (size_t i = 0; i < members_.size(); ++i) {
|
|
336
|
+
double s = score_member(members_[i].translation);
|
|
337
|
+
members_[i].score=s;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
void Memetic::sort_members() {
|
|
342
|
+
std::make_heap(
|
|
343
|
+
members_.begin(),
|
|
344
|
+
members_.end(),
|
|
345
|
+
compare
|
|
346
|
+
);
|
|
347
|
+
|
|
348
|
+
std::sort_heap(
|
|
349
|
+
members_.begin(),
|
|
350
|
+
members_.end(),
|
|
351
|
+
compare
|
|
352
|
+
);
|
|
353
|
+
|
|
354
|
+
member_best_ = members_[capacity_ - 1];
|
|
355
|
+
score_best_ = members_[capacity_ - 1].score;
|
|
356
|
+
score_worst_ = members_[0].score;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
double Memetic::score_mean() {
|
|
360
|
+
auto acc = [](double s, const Member& m) {
|
|
361
|
+
return s + m.score;
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
return std::accumulate(
|
|
365
|
+
members_.begin(),
|
|
366
|
+
members_.end(),
|
|
367
|
+
0.0,
|
|
368
|
+
acc) / capacity_;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
void Memetic::selection_roulette() {
|
|
372
|
+
std::vector<Member> sel(members_);
|
|
373
|
+
std::vector<double> rel_scores(capacity_, 0.0);
|
|
374
|
+
|
|
375
|
+
for (std::size_t i = 0; i < capacity_; ++i) {
|
|
376
|
+
double r = 1.0 / (members_[i].score + 0.01);
|
|
377
|
+
rel_scores.at(i) = r;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
std::vector<double> cum_sum(capacity_, 0.0);
|
|
381
|
+
std::partial_sum(
|
|
382
|
+
rel_scores.begin(),
|
|
383
|
+
rel_scores.end(),
|
|
384
|
+
cum_sum.begin(),
|
|
385
|
+
std::plus<double>()
|
|
386
|
+
);
|
|
387
|
+
|
|
388
|
+
double sum = cum_sum.back();
|
|
389
|
+
members_.clear();
|
|
390
|
+
members_.resize(capacity_);
|
|
391
|
+
int chosen = -1;
|
|
392
|
+
|
|
393
|
+
for (size_t j = 0; j < capacity_; ++j) {
|
|
394
|
+
double probability=rnd::next_double(sum);
|
|
395
|
+
for (size_t i = 0; i < cum_sum.size(); ++i) {
|
|
396
|
+
if (cum_sum[i] > probability) {
|
|
397
|
+
chosen = i;
|
|
398
|
+
|
|
399
|
+
members_.at(j).score = sel.at(chosen).score;
|
|
400
|
+
members_.at(j).translation = sel.at(chosen).translation;
|
|
401
|
+
|
|
402
|
+
break;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
void Memetic::crossover(Member& s1, Member& s2) {
|
|
409
|
+
size_t i = rnd::next_int(1, coding_len_ - 1);
|
|
410
|
+
|
|
411
|
+
Member z1(s1);
|
|
412
|
+
Member z2(s2);
|
|
413
|
+
|
|
414
|
+
for (size_t j = i; j < coding_len_; ++j) {
|
|
415
|
+
z1.translation[j] = s2.translation[j];
|
|
416
|
+
z2.translation[j] = s1.translation[j];
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
if (!out_of_bounds(z1.translation.modulo()) && !out_of_bounds(z2.translation.modulo())) {
|
|
420
|
+
s1 = z1;
|
|
421
|
+
s2 = z2;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
void Memetic::mutation(Member& m) {
|
|
426
|
+
int which = rnd::next_int(coding_len_);
|
|
427
|
+
double v = rnd::next_cauchy(cauchy_mean_alpha_, cauchy_mean_beta_);
|
|
428
|
+
m.translation[which] += v;
|
|
429
|
+
if (out_of_bounds(m.translation.modulo())) {
|
|
430
|
+
m.translation[which] -= v;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
void Memetic::mutation(std::vector<Member>& m) {
|
|
435
|
+
for (std::vector<Member>::iterator it = m.begin(), end = m.end(); it != end; ++it) {
|
|
436
|
+
double r = rnd::next_double();
|
|
437
|
+
if (r < mutation_rate_) {
|
|
438
|
+
mutation(*it);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
void Memetic::stochastic_hill_climbing(
|
|
444
|
+
Member& m,
|
|
445
|
+
const std::vector<double>& params) {
|
|
446
|
+
for (std::size_t i = 0; i < n_local_iterations_; ++i) {
|
|
447
|
+
Member n;
|
|
448
|
+
n.translation = m.translation;
|
|
449
|
+
mutation(n);
|
|
450
|
+
double score_n = score_member(n.translation);
|
|
451
|
+
|
|
452
|
+
if (m.score > score_n) {
|
|
453
|
+
m.translation = n.translation;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
void Memetic::random_restart_hill_climbing(
|
|
459
|
+
Member& m,
|
|
460
|
+
const std::vector<double>& params) {
|
|
461
|
+
unsigned int n_restarts = static_cast<int>(params[0]);
|
|
462
|
+
std::vector<Member> s(n_restarts);
|
|
463
|
+
unsigned int ndx = 0;
|
|
464
|
+
double min = m.score;
|
|
465
|
+
|
|
466
|
+
for (std::size_t r = 0; r < n_restarts; ++r) {
|
|
467
|
+
Member n = m;
|
|
468
|
+
stochastic_hill_climbing(n);
|
|
469
|
+
s[r] = n;
|
|
470
|
+
|
|
471
|
+
if (min > n.score) {
|
|
472
|
+
min = n.score;
|
|
473
|
+
ndx = r;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
m = s[ndx];
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
void Memetic::annealing(
|
|
481
|
+
Member& m,
|
|
482
|
+
const std::vector<double>& params) {
|
|
483
|
+
double T = params[0];
|
|
484
|
+
double alpha = params[1];
|
|
485
|
+
|
|
486
|
+
for (std::size_t i = 0; i < n_local_iterations_; ++i) {
|
|
487
|
+
Member n = m;
|
|
488
|
+
mutation(n);
|
|
489
|
+
double score_n = score_member(n.translation);
|
|
490
|
+
|
|
491
|
+
double probability = std::min(
|
|
492
|
+
1.0,
|
|
493
|
+
std::exp(-(score_n - m.score) / T)
|
|
494
|
+
);
|
|
495
|
+
|
|
496
|
+
double r = rnd::next_double();
|
|
497
|
+
|
|
498
|
+
if (r < probability) {
|
|
499
|
+
m = n;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
T *= alpha;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
void Memetic::luus_jaakola(
|
|
507
|
+
Member& m,
|
|
508
|
+
const std::vector<double>& params) {
|
|
509
|
+
/* TODO */
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
void Memetic::adaptive_random_search(
|
|
513
|
+
Member& m,
|
|
514
|
+
const std::vector<double>& params) {
|
|
515
|
+
double rho_start = params[0];
|
|
516
|
+
double rho_lower_bound = params[1];
|
|
517
|
+
double ex = params[2];
|
|
518
|
+
double ct = params[3];
|
|
519
|
+
int s_ex = static_cast<int>(params[4]);
|
|
520
|
+
int f_ct = static_cast<int>(params[5]);
|
|
521
|
+
|
|
522
|
+
unsigned int k = 0;
|
|
523
|
+
Vector xk = m.translation;
|
|
524
|
+
int ns = 0;
|
|
525
|
+
int nf = 0;
|
|
526
|
+
Vector bk;
|
|
527
|
+
bk.zero();
|
|
528
|
+
double rho_k = rho_start;
|
|
529
|
+
|
|
530
|
+
while (rho_k > rho_lower_bound && k < n_local_iterations_) {
|
|
531
|
+
if (ns >= s_ex) {
|
|
532
|
+
rho_k *= ex;
|
|
533
|
+
} else if (nf >= f_ct) {
|
|
534
|
+
rho_k *= ct;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
std::vector<double> chiv = rnd::next_double(-rho_k, rho_k, 3);
|
|
538
|
+
Vector chi = tls::vector2Vector(chiv);
|
|
539
|
+
Vector tmp;
|
|
540
|
+
|
|
541
|
+
for (unsigned int i = 0; i < 3; ++i) {
|
|
542
|
+
tmp[i] = 2.0 * (xk[i] - chi[i]);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
double score_chi = score_member(chi);
|
|
546
|
+
double score_xk = score_member(xk);
|
|
547
|
+
double score_tmp = score_member(tmp);
|
|
548
|
+
|
|
549
|
+
if (score_chi < score_xk) {
|
|
550
|
+
ns++;
|
|
551
|
+
nf = 0;
|
|
552
|
+
|
|
553
|
+
for (unsigned int i = 0; i < 3; i++) {
|
|
554
|
+
bk[i] = 0.2 * bk[i] + 0.4 * (chi[i] - xk[i]);
|
|
555
|
+
xk[i] = chi[i];
|
|
556
|
+
}
|
|
557
|
+
} else if (score_tmp < score_xk && score_xk <= score_chi) {
|
|
558
|
+
ns++;
|
|
559
|
+
nf = 0;
|
|
560
|
+
|
|
561
|
+
for (unsigned int i = 0; i < 3; i++) {
|
|
562
|
+
bk[i] = bk[i] - 0.4 * (chi[i] - xk[i]);
|
|
563
|
+
xk[i] = 2.0 * xk[i] - chi[i];
|
|
564
|
+
}
|
|
565
|
+
} else {
|
|
566
|
+
ns = 0;
|
|
567
|
+
nf++;
|
|
568
|
+
|
|
569
|
+
for (unsigned int i = 0; i < 3; i++) {
|
|
570
|
+
bk[i] = 0.5 * bk[i];
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
k++;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
m.translation = xk;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
void Memetic::local_search(std::vector<Member>& m) {
|
|
581
|
+
adaptation_ = true;
|
|
582
|
+
|
|
583
|
+
if (local_search_on_) {
|
|
584
|
+
for (std::size_t i = 0; i < capacity_; ++i) {
|
|
585
|
+
double probability = rnd::next_double();
|
|
586
|
+
|
|
587
|
+
if (probability < local_search_rate_) {
|
|
588
|
+
if (local_search_type_ == "stochastic_hill_climbing") {
|
|
589
|
+
stochastic_hill_climbing(m[i]);
|
|
590
|
+
} else if (local_search_type_ == "adaptive_random_search") {
|
|
591
|
+
adaptive_random_search(m[i]);
|
|
592
|
+
} else if (local_search_type_ == "random_restart_hill_climbing") {
|
|
593
|
+
random_restart_hill_climbing(m[i]);
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
adaptation_ = false;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
void Memetic::mating(std::vector<Member>& m) {
|
|
603
|
+
std::vector<Member> offspring;
|
|
604
|
+
|
|
605
|
+
while (m.size() != 0) {
|
|
606
|
+
int j = rnd::next_int(m.size());
|
|
607
|
+
int i = rnd::next_int(m.size());
|
|
608
|
+
|
|
609
|
+
while (i == j) {
|
|
610
|
+
j=rnd::next_int(m.size());
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
Member m1 = m[i];
|
|
614
|
+
Member m2 = m[j];
|
|
615
|
+
|
|
616
|
+
if (i > j) {
|
|
617
|
+
m.erase(m.begin() + i);
|
|
618
|
+
m.erase(m.begin() + j);
|
|
619
|
+
} else if (j > i) {
|
|
620
|
+
m.erase(m.begin() + j);
|
|
621
|
+
m.erase(m.begin() + i);
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
double probability = rnd::next_double();
|
|
625
|
+
if (probability < mating_rate_) {
|
|
626
|
+
crossover(m1, m2);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
offspring.push_back(m1);
|
|
630
|
+
offspring.push_back(m2);
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
m = offspring;
|
|
634
|
+
offspring.clear();
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
Vector Memetic::create_coding() {
|
|
638
|
+
double s = sampling_radius();
|
|
639
|
+
double r = rnd::next_double(s);
|
|
640
|
+
|
|
641
|
+
return rnd::next_plmd_vector(r);
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
bool Memetic::out_of_bounds(double v) {
|
|
645
|
+
double s = sampling_radius();
|
|
646
|
+
|
|
647
|
+
return v > s;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
double Memetic::score_member(const Vector& coding) {
|
|
651
|
+
double action = 0;
|
|
652
|
+
Vector distance;
|
|
653
|
+
const unsigned nl_size = neighbor_list_->size();
|
|
654
|
+
Vector dev = coding;
|
|
655
|
+
|
|
656
|
+
#pragma omp parallel num_threads(get_n_threads_openmp())
|
|
657
|
+
{
|
|
658
|
+
#pragma omp for reduction(+:action)
|
|
659
|
+
for (unsigned int i = 0; i < nl_size; i++) {
|
|
660
|
+
unsigned i0 = neighbor_list_->getClosePair(i).first;
|
|
661
|
+
unsigned i1 = neighbor_list_->getClosePair(i).second;
|
|
662
|
+
|
|
663
|
+
if (getAbsoluteIndex(i0) == getAbsoluteIndex(i1)) {
|
|
664
|
+
continue;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
if (pbc_) {
|
|
668
|
+
distance = pbcDistance(getPosition(i0) + dev, getPosition(i1));
|
|
669
|
+
} else {
|
|
670
|
+
distance = delta(getPosition(i0) + dev, getPosition(i1));
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
action += pairing(distance.modulo());
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
return action;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
void Memetic::print_status() const {
|
|
681
|
+
log.printf("Lowest score: %f \n", score_best_);
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
Vector Memetic::solve() {
|
|
685
|
+
initialize_members();
|
|
686
|
+
|
|
687
|
+
size_t epoch = 0;
|
|
688
|
+
while (epoch < n_global_iterations_) {
|
|
689
|
+
score_members();
|
|
690
|
+
|
|
691
|
+
selection_roulette();
|
|
692
|
+
mating(members_);
|
|
693
|
+
mutation(members_);
|
|
694
|
+
local_search(members_);
|
|
695
|
+
|
|
696
|
+
sort_members();
|
|
697
|
+
|
|
698
|
+
epoch++;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
return member_best_.translation / member_best_.translation.modulo();
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
inline unsigned int Memetic::get_capacity() const {
|
|
705
|
+
return capacity_;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
inline void Memetic::set_capacity(unsigned int capacity) {
|
|
709
|
+
capacity_ = capacity;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
inline unsigned int Memetic::get_coding_len() const {
|
|
713
|
+
return coding_len_;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
inline void Memetic::set_coding_len(unsigned int coding_len) {
|
|
717
|
+
coding_len_ = coding_len;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
inline unsigned int Memetic::get_n_global_iterations() const {
|
|
721
|
+
return n_global_iterations_;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
inline void Memetic::set_n_global_iterations(unsigned int n_global_iterations) {
|
|
725
|
+
n_global_iterations_ = n_global_iterations;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
inline unsigned int Memetic::get_n_local_iterations() const {
|
|
729
|
+
return n_local_iterations_;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
inline void Memetic::set_n_local_iterations(unsigned int n_local_iterations) {
|
|
733
|
+
n_local_iterations_ = n_local_iterations;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
inline double Memetic::get_mating_rate() const {
|
|
737
|
+
return mating_rate_;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
inline void Memetic::set_mating_rate(double mating_rate) {
|
|
741
|
+
mating_rate_ = mating_rate;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
inline double Memetic::get_mutation_rate() const {
|
|
745
|
+
return mutation_rate_;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
inline void Memetic::set_mutation_rate(double mutation_rate) {
|
|
749
|
+
mutation_rate_ = mutation_rate;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
inline double Memetic::get_cauchy_mean() const {
|
|
753
|
+
return cauchy_mean_alpha_;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
inline void Memetic::set_cauchy_mean(double cauchy_mean_alpha) {
|
|
757
|
+
cauchy_mean_alpha_ = cauchy_mean_alpha;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
inline double Memetic::get_cauchy_spread() const {
|
|
761
|
+
return cauchy_mean_beta_;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
inline void Memetic::set_cauchy_spread(double cauchy_mean_beta) {
|
|
765
|
+
cauchy_mean_beta_ = cauchy_mean_beta;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
inline bool Memetic::is_local_search_on() const {
|
|
769
|
+
return local_search_on_;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
inline void Memetic::local_search_on() {
|
|
773
|
+
local_search_on_ = true;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
inline void Memetic::local_search_off() {
|
|
777
|
+
local_search_on_ = false;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
inline double Memetic::get_local_search_rate() const {
|
|
781
|
+
return local_search_rate_;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
inline void Memetic::set_local_search_rate(double local_search_rate) {
|
|
785
|
+
local_search_rate_ = local_search_rate;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
inline std::string Memetic::get_local_search_type() const {
|
|
789
|
+
return local_search_type_;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
inline void Memetic::set_local_search_type(const std::string& local_search_type) {
|
|
793
|
+
local_search_type_ = local_search_type;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
} // namespace maze
|
|
797
|
+
} // namespace PLMD
|
|
798
|
+
|
|
799
|
+
#endif // __PLUMED_maze_Memetic_h
|