Ultra 0.9.4
Loading...
Searching...
No Matches
evaluator.tcc File Reference

Go to the source code of this file.

Functions

template<Evaluator E>
bool load_eva (std::istream &in, E *e)
template<Evaluator E>
bool save_eva (std::ostream &out, const E &e)

Detailed Description

Remarks
This file is part of ULTRA.
License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/

Function Documentation

◆ load_eva()

template<Evaluator E>
bool load_eva ( std::istream & in,
E * e )

Loads the persistent state of an evaluator, if supported.

Template Parameters
Ean Evaluator type
Parameters
[in,out]ininput stream
[in,out]epointer to the evaluator instance
Returns
true if the evaluator was loaded successfully or if the evaluator doesn't support persistence

This function provides optional persistence support for evaluators. If the evaluator type E defines a member function with the signature:

bool load(std::istream &);
bool load(std::istream &in, F *f)
Definition fitness.tcc:190

then that function is invoked. Otherwise, the evaluator is assumed to have no persistent state and the operation succeeds trivially.

◆ save_eva()

template<Evaluator E>
bool save_eva ( std::ostream & out,
const E & e )

Saves the persistent state of an evaluator, if supported.

Template Parameters
Ean Evaluator type
Parameters
[out]outoutput stream
[in]eevaluator instance
Returns
true if the evaluator was saved successfully or if the evaluator doesn't support persistence

This function provides optional persistence support for evaluators. If the evaluator type E defines a member function with the signature:

bool save(std::ostream &) const;
bool save(std::ostream &out, F f)
Definition fitness.tcc:150

then that function is invoked. Otherwise, the evaluator is assumed to have no persistent state and the operation succeeds trivially.