Package net.paulhertz.pixelaudio

# Class RandomContinousGen

java.lang.Object
net.paulhertz.pixelaudio.PixelMapGen
net.paulhertz.pixelaudio.RandomContinousGen

@Deprecated public class RandomContinousGen extends PixelMapGen
Deprecated.
A non-functional experiment, left in as a placeholder. RandomContinousGen attempted to solve a computationally complex problem, a random continuous path that visits every point in a grid. It went off in some interesting directions, but never really worked.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `description`
  Deprecated.

  ### Fields inherited from class net.paulhertz.pixelaudio.PixelMapGen

  `coords, flipx, flipy, fx270, fx90, h, nada, pixelMap, r180, r270, r90, sampleMap, size, transArray, transformType, w`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `RandomContinousGen(int width, int height)`
  Deprecated.
  `RandomContinousGen(int width, int height, AffineTransformType type)`
  Deprecated.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `describe()`
  Deprecated.
  `private boolean`
  `dfs(int x, int y, int width, int height, boolean[][] visited, ArrayList<int[]> path, int endX, int endY)`
  Deprecated.
  `int[]`
  `generate()`
  Deprecated.
  Initializes this.coords, this.pixelMap, this.sampleMap: this is handled by a call to PixelMapGen's setMapsFromCoords() method.
  `private ArrayList<int[]>`
  `generateBoustrophedonPath(int width, int height)`
  Deprecated.
  `private ArrayList<int[]>`
  `generateCoordinates()`
  Deprecated.
  Generically-named method that calls the custom coordinate generation method for a particular PixelMapGen child class.
  `ArrayList<int[]>`
  `generateHamiltonianPath(int width, int height, int maxAttempts)`
  Deprecated.
  Generated by ChatGPT, not quite a solution to a non-trivial problem.
  `private ArrayList<int[]>`
  `generateRandomContinuousCoordinates(int width, int height)`
  Deprecated.
  `private boolean`
  `inBounds(int x, int y, int width, int height)`
  Deprecated.
  `private int[][]`
  `shuffledDirections()`
  Deprecated.
  `boolean`
  `validate(int width, int height)`
  Deprecated.

  ### Methods inherited from class net.paulhertz.pixelaudio.PixelMapGen

  `findNearestPowerOfTwoLessThan, findPowerOfTwo, getCoordinates, getCoordinatesCopy, getHeight, getInversMapFromPixelArray, getPixelMap, getPixelMapCopy, getPixelMapFromCoordinates, getSampleMap, getSampleMapCopy, getSize, getTransformType, getWidth, isPowerOfTwo, loadIndexMaps, randomTransform, setMapsFromCoords, setTransformType, transformCoords`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### description

    public static final String description
    Deprecated.
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### RandomContinousGen

    public RandomContinousGen(int width, int height, AffineTransformType type)
    Deprecated.

  - ### RandomContinousGen

    public RandomContinousGen(int width, int height)
    Deprecated.

- ## Method Details

  - ### describe

    public String describe()
    Deprecated.
    Specified by:
      `describe` in class `PixelMapGen`
    Returns:
      A String describing the mapping generated by your class and any initialization requirements.

  - ### validate

    public boolean validate(int width, int height)
    Deprecated.
    Specified by:
      `validate` in class `PixelMapGen`
    Returns:
      true if the width and height parameters are valid for creating a mapping with this generator, otherwise, false.

  - ### generate

    public int[] generate()
    Deprecated.
    Initializes this.coords, this.pixelMap, this.sampleMap: this is handled by a call to PixelMapGen's setMapsFromCoords() method.
    Specified by:
      `generate` in class `PixelMapGen`
    Returns:
      this.pixelMap, the value for PixelAudioMapper.signalToImageLUT.

  - ### generateCoordinates

    private ArrayList<int[]> generateCoordinates()
    Deprecated.
    Generically-named method that calls the custom coordinate generation method for a particular PixelMapGen child class. Here the method is generateBouCoordinates(). Additional initializations belong here, if required by your coordinate generation method, rather than in the generate() method.
    Returns:
      An ArrayList<int[]> of bitmap coordinates in the order the signal mapping would visit them.

  - ### generateHamiltonianPath

    public ArrayList<int[]> generateHamiltonianPath(int width, int height, int maxAttempts)
    Deprecated.
    Generated by ChatGPT, not quite a solution to a non-trivial problem. ChatGPT: " Thanks for the clarification — and you're absolutely right: generating a truly continuous, non-repeating, 4-connected path that visits every pixel exactly once is a classic problem. What you're asking for is essentially a Hamiltonian path over a grid graph, restricted to 4-connected neighbors. Requirements Recap: Starts at (0, 0) Visits every pixel exactly once Moves only up/down/left/right (4-connected) Never repeats, never jumps Has some randomness in the generated path " This is an NP-Complete computational problem: https://www.researchgate.net/publication/220616693_Hamilton_Paths_in_Grid_Graphs
    Parameters:
      `width` -
      `height` -
    Returns:

  - ### dfs

    private boolean dfs(int x, int y, int width, int height, boolean[][] visited, ArrayList<int[]> path, int endX, int endY)
    Deprecated.

  - ### inBounds

    private boolean inBounds(int x, int y, int width, int height)
    Deprecated.

  - ### shuffledDirections

    private int[][] shuffledDirections()
    Deprecated.

  - ### generateBoustrophedonPath

    private ArrayList<int[]> generateBoustrophedonPath(int width, int height)
    Deprecated.

  - ### generateRandomContinuousCoordinates

    private ArrayList<int[]> generateRandomContinuousCoordinates(int width, int height)
    Deprecated.