-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor: EvaluatorRegistry, AggregatorRegistry
- EvaluatorFactory -> EvaluatorRegistry. Takes map of helper commands, in preparation for 2.0 - AggregatorFactory -> AggregatorRegistry - *Config -> *Options, mainly in preparation for new EvaluatorConfig for disambiguation with EvaluationOptions (which was EvaluatorConfig) - Fix bad includes related to spec
- Loading branch information
Showing
44 changed files
with
437 additions
and
381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#pragma once | ||
|
||
#include "tcframe/aggregator/Aggregator.hpp" | ||
#include "tcframe/aggregator/AggregatorFactory.hpp" | ||
#include "tcframe/aggregator/AggregatorRegistry.hpp" | ||
#include "tcframe/aggregator/MinAggregator.hpp" | ||
#include "tcframe/aggregator/SumAggregator.hpp" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
|
||
#include "tcframe/aggregator/Aggregator.hpp" | ||
#include "tcframe/aggregator/MinAggregator.hpp" | ||
#include "tcframe/aggregator/SumAggregator.hpp" | ||
|
||
using std::string; | ||
|
||
namespace tcframe { | ||
|
||
class AggregatorRegistry { | ||
public: | ||
virtual ~AggregatorRegistry() {} | ||
|
||
virtual Aggregator* get(bool hasSubtasks) { | ||
if (hasSubtasks) { | ||
return new MinAggregator(); | ||
} | ||
return new SumAggregator(); | ||
} | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
#pragma once | ||
|
||
#include "tcframe/evaluator/BatchEvaluator.hpp" | ||
#include "tcframe/evaluator/EvaluationOptions.hpp" | ||
#include "tcframe/evaluator/EvaluationResult.hpp" | ||
#include "tcframe/evaluator/Evaluator.hpp" | ||
#include "tcframe/evaluator/EvaluatorConfig.hpp" | ||
#include "tcframe/evaluator/EvaluatorFactory.hpp" | ||
#include "tcframe/evaluator/EvaluatorHelperRegistry.hpp" | ||
#include "tcframe/evaluator/EvaluatorRegistry.hpp" | ||
#include "tcframe/evaluator/GenerationResult.hpp" | ||
#include "tcframe/evaluator/scorer.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
|
||
#include "tcframe/os.hpp" | ||
#include "tcframe/util.hpp" | ||
#include "scorer.hpp" | ||
|
||
using std::string; | ||
|
||
namespace tcframe { | ||
|
||
class EvaluatorHelperRegistry { | ||
public: | ||
virtual ~EvaluatorHelperRegistry() {} | ||
|
||
virtual Scorer* getScorer(OperatingSystem* os, const optional<string>& scorerCommand) { | ||
if (scorerCommand) { | ||
return new CustomScorer(os, new VerdictCreator(), scorerCommand.value()); | ||
} else { | ||
return new DiffScorer(os); | ||
} | ||
} | ||
}; | ||
|
||
} |
Oops, something went wrong.