10#ifndef CDT_PLUSPLUS_MOVE_OUTCOME_HPP
11#define CDT_PLUSPLUS_MOVE_OUTCOME_HPP
19namespace cdt::ergodic_moves
48 [[nodiscard]]
constexpr auto move() const noexcept -> move_tracker::MoveType
52 [[nodiscard]]
constexpr auto message() const noexcept -> std::string_view
57 case NO_CANDIDATE:
return "No raw proposal site is available.";
59 return "The selected proposal site is not part of the triangulation.";
61 return "The selected proposal site violates a CDT move invariant.";
63 return "The prepared proposal site no longer exists.";
65 return "CGAL rejected execution of the prepared move.";
67 return "The executed move violated a manifold postcondition.";
68 case UNKNOWN_MOVE:
return "The requested Pachner move is unknown.";
70 return "The move failed for an unknown reason.";
79 template <
typename ManifoldType>
80 using MoveResult = std::expected<ManifoldType, MoveError>;
110 [[nodiscard]]
constexpr auto move() const noexcept -> move_tracker::MoveType
115 {
return m_outcome; }
118 [[nodiscard]]
constexpr auto successful() const noexcept ->
bool
126 [[nodiscard]]
constexpr auto accepted() const noexcept ->
bool
141 switch (error.reason())
159 {
return error.message(); }
constexpr auto format_as(MoveError const error) noexcept -> std::string_view
Enable direct formatting through fmt/spdlog.
constexpr auto outcome_from(MoveError const error) noexcept -> MoveOutcome
Classify a structured move error for counter accounting.
std::expected< ManifoldType, MoveError > MoveResult
Value returned by a fallible Pachner-move transformation.
MoveOutcome
Typed state used to route proposal and execution accounting.
@ INAPPLICABLE
The sampled raw site cannot support the move.
@ METROPOLIS_ACCEPTED
Metropolis-Hastings accepted the proposal.
@ EXECUTION_FAILED
Mutation failed after proposal preparation.
@ METROPOLIS_REJECTED
Metropolis-Hastings rejected the proposal.
@ SUCCEEDED
The requested transition completed.
MoveFailure
Actionable reasons a raw move request cannot produce a new state.
@ STALE_CANDIDATE
A prepared proposal no longer resolves.
@ NO_CANDIDATE
No raw proposal site is available.
@ INVARIANT_VIOLATION
A post-mutation manifold check failed.
@ CAUSAL_INVALIDITY
The proposal violates a causal move invariant.
@ INVALID_TOPOLOGY
The proposal site is not in the triangulation.
@ UNKNOWN_MOVE
The requested move kind is unsupported.
@ EXECUTION_FAILURE
CGAL rejected the prepared mutation.
MoveType
The types of 3D ergodic moves.
constexpr auto successful() const noexcept -> bool
constexpr auto outcome() const noexcept -> MoveOutcome
constexpr MetropolisTransition(move_tracker::MoveType const move, MoveOutcome const outcome) noexcept
auto operator==(MetropolisTransition const &other) const -> bool=default
constexpr auto accepted() const noexcept -> bool
constexpr auto move() const noexcept -> move_tracker::MoveType
Typed error returned by move preparation or private execution.
move_tracker::MoveType requested_move
Pachner move whose proposal or execution failed.
constexpr auto message() const noexcept -> std::string_view
constexpr auto reason() const noexcept -> MoveFailure
auto operator==(MoveError const &other) const -> bool=default
constexpr auto move() const noexcept -> move_tracker::MoveType
MoveFailure category
Structured rejection or execution-failure category.