Documentation ¶
Index ¶
- func GetVerbose() bool
- func GetVerboseM() bool
- func GetVerboseX() bool
- func LogGoal(a *D)
- func SetVerbose(v bool)
- func SetVerboseM(v bool)
- func SetVerboseX(v bool)
- type D
- func (a *D) Permille() int
- func (a *D) Search(from ...x.Index)
- func (a *D) SearchFrom(from []x.Index)
- func (a *D) Settings(doit ...do.Option) do.Opt
- func (a *D) ShowGoal(title string) string
- func (a *D) ShowOption() string
- func (a *D) WrapIt(fs ...func(*D)) do.It
- func (a *D) WrapNok(fs ...func(*D) bool) do.Nok
- func (a *D) WrapOk(fs ...func(*D) bool) do.Ok
- func (a *D) WriteTitle(b *strings.Builder, title string)
- func (a *D) WriteTitleLine(b *strings.Builder, title string)
- type L
- type On
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetVerbose ¶
func GetVerbose() bool
GetVerbose reports the current verbosity of this package.
Iff true some detailed processing information may be logged.
func SetVerbose ¶
func SetVerbose(v bool)
SetVerbose controls the verbosity of this package.
Iff true some detailed processing information may be logged.
Types ¶
type D ¶
type D struct { x.Name // the name of the alorithm in use m.M // the problem Matrix *L // the local backtracking data - for visitors *drum.Drum // the update Drum - incremented in DoHide *On // the plug-in functions: what to do when // contains filtered or unexported fields }
D consolidates the data of a dancer.
func AlgorithmC ¶
AlgorithmC returns (a pointer to) a fresh Searcher with silent default settings.
func AlgorithmX ¶
AlgorithmX returns (a pointer to) a fresh Searcher with silent default settings.
func RecursiveC ¶
RecursiveC returns (a pointer to) a fresh Searcher with silent default settings.
func RecursiveX ¶
RecursiveX returns (a pointer to) a fresh Searcher with silent default settings.
func (*D) Permille ¶
Permille returns an estimate of the completion of a search based on the results of OptionCellIsKofN of each option cell found in the current backtrack buffer (as of formula (27)) as truncated integer permille (%o) value.
Note: As of now, OptionCellIsKofN is neither stored nor memoized and thus is a little costly - use with care (if at all) when performance is a priority.
func (*D) SearchFrom ¶
SearchFrom is what a Searcher is busy doing after winding down to from and before rewinding back from from so he may try again from elsewhere.
func (*D) Settings ¶
Settings applies the Setters and returns its undo function which, when evaluated, fully restores the previous setup.
func (*D) ShowGoal ¶
ShowGoal returns a human-readable generic presentation of a solution preceded by a title, iff some is given.
func (*D) ShowOption ¶
ShowOption returns a generic human-readable presentation of all options found in the current backtrack buffer.
func (*D) WriteTitle ¶
WriteTitle writes a title line (iff not empty) preceded by D.Name and M.Name into the provided strings.Builder.
type L ¶
type L struct { x.Cells // the buffer of cells visited per level - compose the solution // contains filtered or unexported fields }
L consolidates local backtracking data and may be visited by On actions.
type On ¶
type On struct { Init do.It // optional: Called on Open/Entry/Start/Begin Done do.It // optional: Called on Done/Exit/Finished/End Skip do.Nok // optional: Called per Enter-Level Goal do.It // optional: Called per Solution Fail do.It // optional: Called per Deadend Leaf do.It // optional: Called per Update // contains filtered or unexported fields }
On consolidates what controls behaviour.