Ejemplo n.º 1
0
 /// <summary>
 /// Basic constructor initializing the algorithm.
 /// </summary>
 /// <param name="periodicOutput"><c>true</c> if the wave and the output is toric.</param>
 /// <param name="seed">Random number generator seed.</param>
 /// <param name="patternFrequencies">The pattern frequencies.</param>
 /// <param name="propagatorState">The propagator state.</param>
 /// <param name="waveHeight">The wave's height.</param>
 /// <param name="waveWidth">The wave's width.</param>
 public GenericWfc(bool periodicOutput, int seed, double[] patternFrequencies,
                   PropagatorState <uint> propagatorState, uint waveHeight, uint waveWidth)
 {
     _Gen = new Random(seed);
     _PatternsFrequencies = Normalize(patternFrequencies);
     _Wave       = new Wave(waveHeight, waveWidth, _PatternsFrequencies);
     _NbPatterns = propagatorState.PatternCount;
     _Propagator = new Propagator(waveHeight, waveWidth, periodicOutput, propagatorState);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructor building the propagator and initializing compatible.
 /// </summary>
 /// <param name="waveHeight">The wave's height.</param>
 /// <param name="waveWidth">The wave's width.</param>
 /// <param name="periodicOutput"><c>true</c> if the wave and the output is toric.</param>
 /// <param name="propagatorState">The propagator state.</param>
 public Propagator(uint waveHeight, uint waveWidth, bool periodicOutput, PropagatorState <uint> propagatorState)
 {
     _PatternsSize    = propagatorState.PatternCount;
     _WaveHeight      = waveHeight;
     _WaveWidth       = waveWidth;
     _PeriodicOutput  = periodicOutput;
     _PropagatorState = propagatorState;
     _Propagating     = new Stack <PropagationEntry>();
     _Compatible      = new Array3D <int[]>(waveHeight, waveWidth, _PatternsSize);
     InitCompatible();
 }