Full Code of citiususc/hipster for AI

1.0.X 26bed7926306 cached
162 files
598.6 KB
149.1k tokens
868 symbols
1 requests
Download .txt
Showing preview only (660K chars total). Download the full file or copy to clipboard to get everything.
Repository: citiususc/hipster
Branch: 1.0.X
Commit: 26bed7926306
Files: 162
Total size: 598.6 KB

Directory structure:
gitextract_rn2ka7pn/

├── .config/
│   ├── deploy-artifacts.sh
│   ├── maven-settings.xml
│   └── publish-javadocs.sh
├── .github/
│   └── workflows/
│       └── maven.yml
├── .gitignore
├── .gitlab-sync
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── hipster-all/
│   ├── pom.xml
│   └── src/
│       └── main/
│           └── java/
│               └── es/
│                   └── usc/
│                       └── citius/
│                           └── hipster/
│                               └── all/
│                                   └── package-info.java
├── hipster-core/
│   ├── pom.xml
│   └── src/
│       ├── main/
│       │   └── java/
│       │       └── es/
│       │           └── usc/
│       │               └── citius/
│       │                   ├── hipster/
│       │                   │   ├── algorithm/
│       │                   │   │   ├── ADStarForward.java
│       │                   │   │   ├── AStar.java
│       │                   │   │   ├── Algorithm.java
│       │                   │   │   ├── BellmanFord.java
│       │                   │   │   ├── BreadthFirstSearch.java
│       │                   │   │   ├── DepthFirstSearch.java
│       │                   │   │   ├── DepthLimitedSearch.java
│       │                   │   │   ├── Hipster.java
│       │                   │   │   ├── IDAStar.java
│       │                   │   │   ├── MultiobjectiveLS.java
│       │                   │   │   ├── NegativeCycleException.java
│       │                   │   │   ├── localsearch/
│       │                   │   │   │   ├── AnnealingSearch.java
│       │                   │   │   │   ├── HillClimbing.java
│       │                   │   │   │   └── package-info.java
│       │                   │   │   └── package-info.java
│       │                   │   ├── graph/
│       │                   │   │   ├── DirectedEdge.java
│       │                   │   │   ├── GraphBuilder.java
│       │                   │   │   ├── GraphEdge.java
│       │                   │   │   ├── GraphSearchProblem.java
│       │                   │   │   ├── HashBasedHipsterDirectedGraph.java
│       │                   │   │   ├── HashBasedHipsterGraph.java
│       │                   │   │   ├── HipsterDirectedGraph.java
│       │                   │   │   ├── HipsterGraph.java
│       │                   │   │   ├── HipsterMutableGraph.java
│       │                   │   │   ├── Pair.java
│       │                   │   │   ├── UndirectedEdge.java
│       │                   │   │   ├── UniqueEdge.java
│       │                   │   │   ├── UnorderedPair.java
│       │                   │   │   └── package-info.java
│       │                   │   ├── model/
│       │                   │   │   ├── ADStarNode.java
│       │                   │   │   ├── AbstractNode.java
│       │                   │   │   ├── CostNode.java
│       │                   │   │   ├── HeuristicNode.java
│       │                   │   │   ├── Node.java
│       │                   │   │   ├── SimpleTransition.java
│       │                   │   │   ├── Transition.java
│       │                   │   │   ├── function/
│       │                   │   │   │   ├── ActionFunction.java
│       │                   │   │   │   ├── ActionStateTransitionFunction.java
│       │                   │   │   │   ├── BinaryFunction.java
│       │                   │   │   │   ├── CostFunction.java
│       │                   │   │   │   ├── HeuristicFunction.java
│       │                   │   │   │   ├── NodeExpander.java
│       │                   │   │   │   ├── NodeFactory.java
│       │                   │   │   │   ├── ScalarFunction.java
│       │                   │   │   │   ├── TransitionFunction.java
│       │                   │   │   │   ├── impl/
│       │                   │   │   │   │   ├── ADStarNodeExpander.java
│       │                   │   │   │   │   ├── ADStarNodeFactory.java
│       │                   │   │   │   │   ├── ADStarNodeUpdater.java
│       │                   │   │   │   │   ├── BinaryOperation.java
│       │                   │   │   │   │   ├── LazyActionStateTransitionFunction.java
│       │                   │   │   │   │   ├── LazyNodeExpander.java
│       │                   │   │   │   │   ├── Product.java
│       │                   │   │   │   │   ├── ScalarOperation.java
│       │                   │   │   │   │   ├── StateTransitionFunction.java
│       │                   │   │   │   │   ├── WeightedNodeFactory.java
│       │                   │   │   │   │   └── package-info.java
│       │                   │   │   │   └── package-info.java
│       │                   │   │   ├── impl/
│       │                   │   │   │   ├── ADStarNodeImpl.java
│       │                   │   │   │   ├── UnweightedNode.java
│       │                   │   │   │   ├── WeightedNode.java
│       │                   │   │   │   └── package-info.java
│       │                   │   │   ├── package-info.java
│       │                   │   │   └── problem/
│       │                   │   │       ├── ProblemBuilder.java
│       │                   │   │       ├── SearchComponents.java
│       │                   │   │       ├── SearchProblem.java
│       │                   │   │       └── package-info.java
│       │                   │   └── util/
│       │                   │       ├── F.java
│       │                   │       ├── Function.java
│       │                   │       ├── Iterators.java
│       │                   │       ├── Predicate.java
│       │                   │       └── examples/
│       │                   │           ├── RomanianProblem.java
│       │                   │           ├── maze/
│       │                   │           │   ├── Maze2D.java
│       │                   │           │   ├── MazeSearch.java
│       │                   │           │   ├── Mazes.java
│       │                   │           │   └── package-info.java
│       │                   │           └── package-info.java
│       │                   └── lab/
│       │                       └── hipster/
│       │                           └── collections/
│       │                               ├── FibonacciHeap.java
│       │                               ├── HashQueue.java
│       │                               ├── adapter/
│       │                               │   ├── HeuristicNodePriorityEvaluator.java
│       │                               │   ├── PriorityEvaluator.java
│       │                               │   ├── PriorityFibonacciQueue.java
│       │                               │   └── package-info.java
│       │                               └── package-info.java
│       └── test/
│           └── java/
│               └── es/
│                   └── usc/
│                       └── citius/
│                           ├── hipster/
│                           │   ├── algorithm/
│                           │   │   └── problem/
│                           │   │       └── romanian/
│                           │   │           ├── ADStarRomaniaProblemOptimalSearchTest.java
│                           │   │           ├── AStarRomaniaProblemOptimalSearchTest.java
│                           │   │           ├── BellmanFordRomaniaProblemOptimalSearchTest.java
│                           │   │           ├── DijkstraRomaniaProblemOptimalSearchTest.java
│                           │   │           ├── IDAStarRomaniaProblemOptimalSearchTest.java
│                           │   │           ├── RomaniaProblemOptimalHeuristicSearchTest.java
│                           │   │           └── RomaniaProblemOptimalSearchTest.java
│                           │   ├── graph/
│                           │   │   ├── HashBasedHipsterDirectedGraphTest.java
│                           │   │   ├── HashBasedHipsterGraphTest.java
│                           │   │   └── UndirectedEdgeTest.java
│                           │   └── util/
│                           │       └── graph/
│                           │           ├── GraphBuilderTest.java
│                           │           └── RomanianProblemGraph.java
│                           └── lab/
│                               └── hipster/
│                                   ├── algorithm/
│                                   │   ├── BellmanFordTest.java
│                                   │   ├── DepthFirstSearchTest.java
│                                   │   ├── DepthLimitedSearchTest.java
│                                   │   └── MultiobjectiveShortestPathTest.java
│                                   ├── collection/
│                                   │   └── HashQueueTest.java
│                                   └── maze/
│                                       └── Maze2DTest.java
├── hipster-examples/
│   ├── pom.xml
│   └── src/
│       ├── main/
│       │   └── java/
│       │       └── es/
│       │           └── usc/
│       │               └── citius/
│       │                   └── hipster/
│       │                       └── examples/
│       │                           ├── ASCIIMazeVisualizer.form
│       │                           ├── ASCIIMazeVisualizer.java
│       │                           ├── BlueprintsGraphMultiobjectiveSearch.java
│       │                           ├── DirectedGraphSearchExample.java
│       │                           ├── EightPuzzleProblemExample.java
│       │                           ├── EightQueensProblemExample.java
│       │                           ├── EightQueensProblemExampleWithAnnealingSearch.java
│       │                           ├── MazeShortestPathExample.java
│       │                           ├── RomanianProblemDFSExample.java
│       │                           ├── RomanianProblemExample.java
│       │                           ├── SimpleEightPuzzleExample.java
│       │                           ├── UndirectedGraphSearchExample.java
│       │                           ├── package-info.java
│       │                           └── problem/
│       │                               ├── NPuzzle.java
│       │                               ├── NQueens.java
│       │                               └── package-info.java
│       └── test/
│           └── java/
│               └── es/
│                   └── usc/
│                       └── citius/
│                           ├── hipster/
│                           │   └── search/
│                           │       └── local/
│                           │           └── NQueensEHCTest.java
│                           └── lab/
│                               └── hipster/
│                                   └── examples/
│                                       └── NQueensTest.java
├── hipster-extensions/
│   ├── pom.xml
│   └── src/
│       ├── main/
│       │   └── java/
│       │       └── es/
│       │           └── usc/
│       │               └── citius/
│       │                   └── hipster/
│       │                       └── extensions/
│       │                           └── graph/
│       │                               ├── HashTableHipsterDirectedGraph.java
│       │                               └── HashTableHipsterGraph.java
│       └── test/
│           └── java/
│               └── es/
│                   └── usc/
│                       └── citius/
│                           └── hipster/
│                               └── extensions/
│                                   └── graph/
│                                       ├── HashTableHipsterDirectedGraphTest.java
│                                       └── HashTableHipsterGraphTest.java
├── hipster-test/
│   └── pom.xml
├── hipster-third-party-graphs/
│   ├── pom.xml
│   └── src/
│       ├── main/
│       │   └── java/
│       │       └── es/
│       │           └── usc/
│       │               └── citius/
│       │                   └── hipster/
│       │                       └── thirdparty/
│       │                           └── graphs/
│       │                               ├── blueprints/
│       │                               │   ├── BlueprintsHipsterDirectedGraphAdapter.java
│       │                               │   ├── BlueprintsHipsterGraphAdapter.java
│       │                               │   └── package-info.java
│       │                               └── jung/
│       │                                   ├── JUNGHipsterDirectedGraphAdapter.java
│       │                                   ├── JUNGHipsterGraphAdapter.java
│       │                                   └── package-info.java
│       └── test/
│           └── java/
│               └── es/
│                   └── usc/
│                       └── citius/
│                           └── hipster/
│                               └── thirdparty/
│                                   └── graphs/
│                                       └── JUNGHipsterGraphAdapterTest.java
├── pom.xml
└── src/
    ├── main/
    │   ├── doclava/
    │   │   └── custom/
    │   │       └── assets/
    │   │           └── hipster-template/
    │   │               ├── assets/
    │   │               │   ├── customizations.css
    │   │               │   └── customizations.js
    │   │               ├── components/
    │   │               │   ├── api_filter.cs
    │   │               │   ├── left_nav.cs
    │   │               │   ├── masthead.cs
    │   │               │   └── search_box.cs
    │   │               ├── customizations.cs
    │   │               └── footer.cs
    │   └── javadoc/
    │       ├── overview.html
    │       └── stylesheet.css
    └── site/
        ├── markdown/
        │   ├── citation.md
        │   └── index.md
        ├── resources/
        │   └── css/
        │       └── site.css
        └── site.xml

================================================
FILE CONTENTS
================================================

================================================
FILE: .config/deploy-artifacts.sh
================================================
#!/bin/bash

echo "Auto-deploying Hipster4j snapshots..."
echo "Current branch: $TRAVIS_BRANCH"
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
  echo "Skipping snapshot deployment for pull request"
  exit
fi
echo "Running mvn deploy, current directory: `pwd`"
# Deploy to Sonatype Nexus OSS
mvn --settings .config/maven-settings.xml deploy -DskipTests=true
echo "Deployment script finished." 


================================================
FILE: .config/maven-settings.xml
================================================
<!--
~ Copyright 2014 Centro de Investigación en Tecnoloxías da Información (CITIUS),
~ University of Santiago de Compostela (USC) http://citius.usc.es.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <servers>
        <!-- Sonatype Maven repository for snapshots -->
        <server>
            <id>sonatype-nexus-snapshots</id>
            <username>${env.SONATYPE_SNAPSHOT_USERNAME}</username>
            <password>${env.SONATYPE_SNAPSHOT_PASSWORD}</password>
        </server>
        <server>
            <id>bintray-hipster4j-maven</id>
            <username>${env.BINTRAY_USER}</username>
            <password>${env.BINTRAY_API_KEY}</password>
        </server>
    </servers>

    <profiles>
        <profile>
            <repositories>
                <repository>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                    <id>bintray-hipster4j-maven</id>
                    <name>bintray</name>
                    <url>http://dl.bintray.com/hipster4j/maven</url>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                    <id>bintray-hipster4j-maven</id>
                    <name>bintray-plugins</name>
                    <url>http://dl.bintray.com/hipster4j/maven</url>
                </pluginRepository>
            </pluginRepositories>
            <id>bintray</id>
        </profile>
    </profiles>
    <activeProfiles>
        <activeProfile>bintray</activeProfile>
    </activeProfiles>
</settings> 


================================================
FILE: .config/publish-javadocs.sh
================================================
#!/bin/bash

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
  echo "Skipping Javadoc publication for pull request"
  exit
fi

if [ "$TRAVIS_TAG" == "" ]; then
  echo "Current version is not a release, skipping Javadoc publication"
  exit
fi

echo "Auto publishing latest javadocs..."
echo "TRAVIS_REPO_SLUG=$TRAVIS_REPO_SLUG - TRAVIS_JDK_VERSION=$TRAVIS_JDK_VERSION - TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST"

# Decide the documentation version folder name depending on the branch and the version in the pom.xml
VERSION=`grep -m 1 "<hipster.version>" pom.xml | cut -d ">" -f 2 | cut -d "<" -f 1`

# Validate if the version is correct (example 1.0.0-SNAPSHOT, or 1.0.0-alpha-1)
VERSION_REGEX='^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9_]+(-[0-9]+)?)?$'
if [[ $VERSION =~ $VERSION_REGEX ]]; then
  echo "Current version is $VERSION"
else
  echo "Version error. Unrecognized version $VERSION"
  exit 1
fi

echo "Deploying Hipster [$VERSION] javadocs to GitHub gh-pages"
echo "Current directory is: `pwd`"

echo "Building javadocs..."
# Generate Javadocs in target/apidocs
mvn javadoc:aggregate

# Clone Hipster4j GitHub gh-pages for Javadocs
git clone --quiet --branch=gh-pages https://github.com/hipster4j/hipster-javadocs.git gh-pages > /dev/null

# Overwrite the previous version with the new one
cp -Rf target/apidocs/* gh-pages/

# Create a new folder with the version number and copy the latest version to it
mkdir gh-pages/$VERSION
cp -Rf target/apidocs/* gh-pages/$VERSION/

# Now prepare for uploading the site to gh-pages
cd gh-pages

# Config git user and credentials
git config --global user.email "travis@travis-ci.org"
git config --global user.name "travis-ci"
git config credential.helper "store --file=.git/credentials"
echo "https://${GITHUB_TOKEN}:@github.com" > .git/credentials

git add -A
git commit -a -m "auto-commit $TRAVIS_BRANCH Hipster4j Javadocs v$VERSION (build $TRAVIS_BUILD_NUMBER)"
git push -q origin gh-pages > /dev/null
echo "Finished"



================================================
FILE: .github/workflows/maven.yml
================================================
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Maven

on:
  push:
    branches-ignore: 'wip/*'
  pull_request:
    branches: '*'

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up JDK 11
      uses: actions/setup-java@v2
      with:
        java-version: '11'
        distribution: 'adopt'
        cache: maven
    - name: Build with Maven
      run: mvn -B package --file pom.xml


================================================
FILE: .gitignore
================================================
*.class

# Package Files #
*.jar
*.war
*.ear
*~

.classpath
.project
.directory
.settings/
target/

# Netbeans specific #
nbproject/private/
build/
nbbuild/
dist/
nbdist/
nbactions.xml
nb-configuration.xml

# Idea specific #
*.iml
.idea

# Eclipse specific #
.metadata/



================================================
FILE: .gitlab-sync
================================================



================================================
FILE: CHANGELOG.md
================================================
# Change Log

## [1.0.1](https://github.com/citiususc/hipster/tree/1.0.1) (2016-05-16)
[Full Changelog](https://github.com/citiususc/hipster/compare/v1.0.0...v1.0.1)

**Fixed bugs:**

- open queue does not manage repeated elements [\#170](https://github.com/citiususc/hipster/issues/170)

**Closed issues:**

- Add heuristic to maze example [\#165](https://github.com/citiususc/hipster/issues/165)
- Implementation of Annealing localsearch [\#158](https://github.com/citiususc/hipster/issues/158)

## [v1.0.0](https://github.com/citiususc/hipster/tree/v1.0.0) (2016-02-22)
[Full Changelog](https://github.com/citiususc/hipster/compare/v1.0.0-rc2...v1.0.0)

**Implemented enhancements:**

- Complete javadoc documentation for hipster.algorithm.problem \(core\) [\#5](https://github.com/citiususc/hipster/issues/5)
- Complete javadoc documentation for hipster.algorithm.multiobjective \(core\) [\#4](https://github.com/citiususc/hipster/issues/4)
- Add a depth or path size attribute to nodes [\#140](https://github.com/citiususc/hipster/issues/140)
- Replace Stack with ArrayDeque [\#137](https://github.com/citiususc/hipster/issues/137)
- Detect negative cycle conditions in BellmanFord [\#136](https://github.com/citiususc/hipster/issues/136)
- Update scripts to auto-generate javadocs for snapshot versions [\#121](https://github.com/citiususc/hipster/issues/121)

**Fixed bugs:**

- When Search Result printed Action list is now in reverse order \(in v1.0.0.rc2 vs v1.0.0.rc1\) [\#141](https://github.com/citiususc/hipster/issues/141)
- Fix coveralls maven plugin [\#131](https://github.com/citiususc/hipster/issues/131)

**Closed issues:**

- Update gitignore file to include Eclipse editor files [\#146](https://github.com/citiususc/hipster/issues/146)
- When checking if point in bounds, also check lower bounds. [\#144](https://github.com/citiususc/hipster/issues/144)
- Integration with codecov.io [\#152](https://github.com/citiususc/hipster/issues/152)
- Replace Cobertura with JaCoCo [\#151](https://github.com/citiususc/hipster/issues/151)
- Change maven compiler version to 1.6 [\#150](https://github.com/citiususc/hipster/issues/150)
- Fix incorrect URL for javadoc publication [\#149](https://github.com/citiususc/hipster/issues/149)
- Remove unused citius-nexus-snapshot in maven-settings.xml [\#148](https://github.com/citiususc/hipster/issues/148)
- Upgrade config to deploy on bintray [\#143](https://github.com/citiususc/hipster/issues/143)
- Show unit time \(ms\) in algorithm result toString\(\) method [\#139](https://github.com/citiususc/hipster/issues/139)
- Detect "NoSuchElementException" situations in AbstractIterator [\#138](https://github.com/citiususc/hipster/issues/138)

**Merged pull requests:**

- Implementation of the Annealing search algorithm [\#168](https://github.com/citiususc/hipster/pull/168) ([cmoins](https://github.com/cmoins))
- Semicolon bug [\#167](https://github.com/citiususc/hipster/pull/167) ([andyg7](https://github.com/andyg7))
- Contrib/165 [\#166](https://github.com/citiususc/hipster/pull/166) ([PaulJackson123](https://github.com/PaulJackson123))
- Implementation of Depth Limited Search \#157 [\#164](https://github.com/citiususc/hipster/pull/164) ([gabizekany](https://github.com/gabizekany))
- Contrib/issue 64 [\#160](https://github.com/citiususc/hipster/pull/160) ([michaelhaaf](https://github.com/michaelhaaf))
- Contrib/issue 137 [\#156](https://github.com/citiususc/hipster/pull/156) ([michaelhaaf](https://github.com/michaelhaaf))
- fix \#146 : Update .gitignore to include Eclipse specific files. [\#147](https://github.com/citiususc/hipster/pull/147) ([gahrae](https://github.com/gahrae))
- fix \#144 : Make Maze2D.pointInBounds\(\) check lower bounds too. [\#145](https://github.com/citiususc/hipster/pull/145) ([gahrae](https://github.com/gahrae))

## [v1.0.0-rc2](https://github.com/citiususc/hipster/tree/v1.0.0-rc2) (2015-08-12)
[Full Changelog](https://github.com/citiususc/hipster/compare/v1.0.0-rc1...v1.0.0-rc2)

**Implemented enhancements:**

- Fix deploy script to deploy only SNAPSHOT versions [\#111](https://github.com/citiususc/hipster/issues/111)
- Update travis.yml to use the new container-based CI [\#135](https://github.com/citiususc/hipster/issues/135)
- StateTransitionFunction is not lazy [\#134](https://github.com/citiususc/hipster/issues/134)
- LazyActionStateTransitionFunction is not lazy [\#133](https://github.com/citiususc/hipster/issues/133)
- LazyNodeExpander is not lazy [\#132](https://github.com/citiususc/hipster/issues/132)
- Create a branch whitelist in travis.yml [\#129](https://github.com/citiususc/hipster/issues/129)
- Refactor the basic \(non-guava\) graph implementations and improve unit tests [\#128](https://github.com/citiususc/hipster/issues/128)
- Confusing usage of the GraphBuilder [\#119](https://github.com/citiususc/hipster/issues/119)
- Remove dependencies with Guava from hipster-core [\#113](https://github.com/citiususc/hipster/issues/113)

**Fixed bugs:**

- Java \<1.8 Incompatibility [\#130](https://github.com/citiususc/hipster/issues/130)
- BellmanFord iterator search method fails [\#127](https://github.com/citiususc/hipster/issues/127)
- NullPointerException using Bellman-Ford algorithm [\#124](https://github.com/citiususc/hipster/issues/124)
- RomaniaaProblemOptimalSearchTest does not detect solutions with different length [\#123](https://github.com/citiususc/hipster/issues/123)
- AD\* node expander check isConsistent\(\) after node.g and node.v changed [\#122](https://github.com/citiususc/hipster/issues/122)
- assert check in BinaryOperation constructor done with `equals\(\)` instead of `compare\(\)` [\#120](https://github.com/citiususc/hipster/issues/120)
- restrictive type in ProblemBuilder\(...\)defineProblemWithoutExplicitActions\(\).useTransitionFunction\(\) [\#115](https://github.com/citiususc/hipster/issues/115)
- change visibility of attributes and methods in Algorithm subclasses [\#114](https://github.com/citiususc/hipster/issues/114)
- AbstractNode.path\(\) in reversed order [\#72](https://github.com/citiususc/hipster/issues/72)
- Method search\(SearchListener\) from Algorithms does not stop [\#49](https://github.com/citiususc/hipster/issues/49)

**Closed issues:**

- Create new module "hipster-extensions" with classes depending on Guava [\#125](https://github.com/citiususc/hipster/issues/125)
- Update `site.url` in parent pom.xml [\#126](https://github.com/citiususc/hipster/issues/126)
- hipster.version in branch development should not be the same than last release [\#118](https://github.com/citiususc/hipster/issues/118)
- hipster.version defined in root pom.xmi but not used [\#117](https://github.com/citiususc/hipster/issues/117)
- Implement common tests for heuristic search algorithms [\#71](https://github.com/citiususc/hipster/issues/71)

## [v1.0.0-rc1](https://github.com/citiususc/hipster/tree/v1.0.0-rc1) (2014-12-10)
[Full Changelog](https://github.com/citiususc/hipster/compare/v1.0.0-alpha-1...v1.0.0-rc1)

**Implemented enhancements:**

- Complete package-index descriptions [\#86](https://github.com/citiususc/hipster/issues/86)
- Bump doxia version to 1.6 [\#85](https://github.com/citiususc/hipster/issues/85)
- Add DFS cycle support [\#84](https://github.com/citiususc/hipster/issues/84)
- Add a status bar at the bottom of the ASCII Visualizer [\#79](https://github.com/citiususc/hipster/issues/79)
- Add option to disable the ASCII Visualizer realtime printing [\#76](https://github.com/citiususc/hipster/issues/76)
- Add support for custom goal test conditions \[CISTI2014\] [\#70](https://github.com/citiususc/hipster/issues/70)
- Modify action/state function interfaces to use nodes to compute successors [\#68](https://github.com/citiususc/hipster/issues/68)
- Search Problems should provide an initial node and the node expander [\#67](https://github.com/citiususc/hipster/issues/67)
- Remove redundant algorithm factories [\#60](https://github.com/citiususc/hipster/issues/60)
- Make Nodes generic in each algorithm implementation [\#57](https://github.com/citiususc/hipster/issues/57)
- Implement abstract definition for graph-based problems [\#56](https://github.com/citiususc/hipster/issues/56)
- Create a node transition function [\#53](https://github.com/citiususc/hipster/issues/53)
- Clean algorithm factory duplications [\#50](https://github.com/citiususc/hipster/issues/50)
- Rename Algorithms class to Hipster [\#48](https://github.com/citiususc/hipster/issues/48)
- Cannot access the heuristic from HeuristicNode [\#45](https://github.com/citiususc/hipster/issues/45)
- Change factory.node to factory.makeNode [\#42](https://github.com/citiususc/hipster/issues/42)
- Reorganize maven modules [\#39](https://github.com/citiususc/hipster/issues/39)
- Pretty 8-puzzle string representation [\#26](https://github.com/citiususc/hipster/issues/26)
- Complete javadoc documentation for hipster.util.parallel \(core\) [\#14](https://github.com/citiususc/hipster/issues/14)
- Complete javadoc documentation for hipster.util.maze \(core\) [\#13](https://github.com/citiususc/hipster/issues/13)
- Complete javadoc documentation for hipster.algorithm.node.impl \(core\) [\#12](https://github.com/citiususc/hipster/issues/12)
- Complete javadoc documentation for hipster.algorithm.node.adstar \(core\) [\#11](https://github.com/citiususc/hipster/issues/11)
- Complete javadoc documentation for hipster.algorithm.node \(core\) [\#10](https://github.com/citiususc/hipster/issues/10)
- Complete javadoc documentation for hipster.algorithm.function.impl [\#9](https://github.com/citiususc/hipster/issues/9)
- Complete javadoc documentation for hipster.algorithm.impl \(core\) [\#8](https://github.com/citiususc/hipster/issues/8)
- Complete javadoc documentation for hipster.function \(core\) [\#7](https://github.com/citiususc/hipster/issues/7)
- Complete javadoc documentation for hipster.collection [\#6](https://github.com/citiususc/hipster/issues/6)
- Complete javadoc documentation for hipster.algorithm.factory \(core\) [\#3](https://github.com/citiususc/hipster/issues/3)
- Complete javadoc documentation for hipster.algorithm.combinatorial \(core\) [\#2](https://github.com/citiususc/hipster/issues/2)
- Complete javadoc documentation for hipster.algorithm \(core\) [\#1](https://github.com/citiususc/hipster/issues/1)

**Fixed bugs:**

- Fix google analytics tracking code [\#90](https://github.com/citiususc/hipster/issues/90)
- Fix download links in the main web page [\#89](https://github.com/citiususc/hipster/issues/89)
- Fix link to milestones in README.md [\#88](https://github.com/citiususc/hipster/issues/88)
- Twitter icon is missing in the website [\#80](https://github.com/citiususc/hipster/issues/80)
- IDA\* minFLimit inconsistent updates [\#74](https://github.com/citiususc/hipster/issues/74)
- Fix NQueens.java getLineSeparator\(\) incompatible with jdk 6 [\#69](https://github.com/citiususc/hipster/issues/69)
- Variable num of iters with Dijkstra/A\*/IDA\* after refactor [\#63](https://github.com/citiususc/hipster/issues/63)
- Bad value of HeuristicNode.getScore\(\) when the initial node is instantiated by HeuristicNodeImplFactory [\#52](https://github.com/citiususc/hipster/issues/52)
- Fix A\* cost comparator [\#43](https://github.com/citiususc/hipster/issues/43)
- SetCoverIterator fails when there is only one element [\#35](https://github.com/citiususc/hipster/issues/35)

**Closed issues:**

- Generate maven site with markdown with reflow maven skin [\#31](https://github.com/citiususc/hipster/issues/31)
- Update bash scripts for automatic deployment [\#112](https://github.com/citiususc/hipster/issues/112)
- collections / adapters package - Javadoc documentation [\#110](https://github.com/citiususc/hipster/issues/110)
- util.graph package - Javadoc documentation [\#109](https://github.com/citiususc/hipster/issues/109)
- util.examples / util.examples.maze - Javadoc documentation [\#108](https://github.com/citiususc/hipster/issues/108)
- thirdparty package - Javadoc documentation [\#107](https://github.com/citiususc/hipster/issues/107)
- model.problem package - Javadoc documentation [\#106](https://github.com/citiususc/hipster/issues/106)
- model.impl package - Javadoc documentation [\#105](https://github.com/citiususc/hipster/issues/105)
- model.function.impl package - Javadoc documentation [\#104](https://github.com/citiususc/hipster/issues/104)
- model.function package - Javadoc documentation [\#103](https://github.com/citiususc/hipster/issues/103)
- model package - Javadoc documentation [\#102](https://github.com/citiususc/hipster/issues/102)
- examples.problem package - Javadoc documentation [\#101](https://github.com/citiususc/hipster/issues/101)
- examples package - Javadoc documentation [\#100](https://github.com/citiususc/hipster/issues/100)
- localsearch package - Javadoc documentation [\#99](https://github.com/citiususc/hipster/issues/99)
- MultiobjectiveLS / Iterator - Javadoc documentation \(package Algorithm\) [\#98](https://github.com/citiususc/hipster/issues/98)
- IDAStar / Iterator - Javadoc documentation \(package Algorithm\) [\#97](https://github.com/citiususc/hipster/issues/97)
- Hipster class - Javadoc documentation \(package Algorithm\) [\#96](https://github.com/citiususc/hipster/issues/96)
- DFS Algorithm - Javadoc documentation \(package Algorithm\) [\#95](https://github.com/citiususc/hipster/issues/95)
- BFS Algorithm - Javadoc documentation \(package Algorithm\) [\#94](https://github.com/citiususc/hipster/issues/94)
- BellmanFord / Iterator - Javadoc documentation \(package Algorithm\) [\#93](https://github.com/citiususc/hipster/issues/93)
- ADStarForward / Iterator - Javadoc documentation \(package Algorithm\) [\#92](https://github.com/citiususc/hipster/issues/92)
- Fix SearchResult toString method [\#87](https://github.com/citiususc/hipster/issues/87)
- Add an example using the ProblemBuilder in README.md [\#82](https://github.com/citiususc/hipster/issues/82)
- Create a Swing-based Maze search visualizer [\#73](https://github.com/citiususc/hipster/issues/73)
- Adapt AD\* to the new generic action node model [\#66](https://github.com/citiususc/hipster/issues/66)
- Auto deploy javadoc to gh-pages with Maven [\#61](https://github.com/citiususc/hipster/issues/61)
- Enforced Hill Climbing [\#55](https://github.com/citiususc/hipster/issues/55)
- Create N-queen example [\#54](https://github.com/citiususc/hipster/issues/54)
- Publish 1.0.0-rc1 artifacts to the central repository [\#40](https://github.com/citiususc/hipster/issues/40)
- IterativeSetCover does not fulfill the iterator contract [\#38](https://github.com/citiususc/hipster/issues/38)
- Insert pluginManagement in parent pom [\#37](https://github.com/citiususc/hipster/issues/37)
- Move examples to a hipster-examples package [\#36](https://github.com/citiususc/hipster/issues/36)
- Implement IDA\* algorithm [\#34](https://github.com/citiususc/hipster/issues/34)
- Customize doclava css for javadoc [\#30](https://github.com/citiususc/hipster/issues/30)
- Add test for HashQueue [\#29](https://github.com/citiususc/hipster/issues/29)
- Prepare the release of the 0.1.0 version [\#28](https://github.com/citiususc/hipster/issues/28)
- Maze search examples with realtime output printing [\#27](https://github.com/citiususc/hipster/issues/27)
- Create README.md with markdown [\#21](https://github.com/citiususc/hipster/issues/21)
- 8-Puzzle example with different heuristics [\#16](https://github.com/citiususc/hipster/issues/16)
- Implementation of the breadth-first-search algorithm [\#15](https://github.com/citiususc/hipster/issues/15)

## [v1.0.0-alpha-1](https://github.com/citiususc/hipster/tree/v1.0.0-alpha-1) (2014-05-21)


\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*

================================================
FILE: CONTRIBUTING.md
================================================
# Contributing to Hipster4j

First of all, thank you so much for being interested in contributing to Hipster4j!. This document will guide you through this process. You can contribute in different ways:

- Reporting issues
- Fixing bugs or developing new features
- Creating new examples
- Sending a motivating email telling us how do you like the library (or dislike) :)

## Issues
Feel free to open new issues or participating in the discussion of the existing ones on 
[this repository](https://github.com/citiususc/hipster/issues), but before doing so, please make sure that the issue is not duplicated and/or the discussion is related to the topic of the issue.

## Pull requests
Code contributions are welcome following a process which guarantees the long-term maintainability of the project. 
You can contribute either with bugfixes or new features. Before submitting a new feature, we highly encourage you to first open a new issue describing its motivation and details and discuss it with one of the project mantainers. This will ensure that the feature fits well in the project.

### Step 1: Open a new issue (if not opened yet)
Before starting to code, it is desirable to first open an issue describing the bug or the new feature. Please be sure the issue is not duplicated.

### Step 2: Fork the repository
Fork the project https://github.com/citiususc/hipster into your account. Then, check out your copy of the project locally.
```
git clone git@github.com:username/hipster.git
cd hipster
git remote add upstream https://github.com/citiususc/hipster.git
```

### Step 3: Create a new feature branch `contrib/issue-number`
Put your code in a new feature branch. The name of the new branch should start with `contrib/`. This convention will help us to keep track of future changes from pull requests.
```
git checkout -b contrib/issue-number origin/branch
```
Note that origin/‘branch’ would correspond with any of the current development branches (for example 1.0.X) but never the origin/master branch. For example, suppose that the latest version of the project is v1.0.0 and you want to fix a new bug that you discovered in this version. If the new reported issue has an id, say, #186, then you would create your feature branch in this way:
```
git checkout -b contrib/issue-186 origin/1.0.X
```

### Step 4: Committing your changes
First of all, make sure that git is configured with your complete name and email address. It is desirable to use the same email of your Github account, this will help to identify the contributions:
```
git config --global user.name "Your Name"
git config --global user.email "your@email.com"
```
Write a good commit message. It should describe the changes you made and its motivation. Be sure to reference the issue you are working in the commit that finishes your contribution using one the [keywords to close issues in Github](https://help.github.com/articles/closing-issues-via-commit-messages/).
If your commit message is too long, try to summarize the changes in the header of the message, like this:
```
fix #xx : summarize your commit in one line

If needed, explain more in detail the changes introduced in your 
commit and the motivation. You could introduce some background 
about the issue you worked in. 

This message can contain several paragraphs and be as long as 
you need, but try to do a good indentation: the columns should 
be shorter than 72 characters and with a proper word-wrap. 
The command `git log` will print this complete text in a nice 
way if you format it properly.
```
The header and the body of the commit message must be separated by a line in blank. The header is the message shown when running the command `git shortlog`.

#### Keep your branch in sync
Remember to keep in sync your version. Use git rebase instead of git merge to bring all the changes from the upstream branch to your feature branch:

```
git fetch upstream
git rebase upstream/branch #where branch would be 1.0.X, 1.1.X etc
```

#### Test your code
Verify that your changes are actually working by adding the required unit tests. It is desirable to include unit test covering all new features you implement. Also, if you find a bug which is not currently detected by the unit tests you might consider to implement a new one or modify the current implementation. After this, you can verify that everything works fine after your changes with:

```
mvn clean test
```

### Step 5: Push your changes

Push your changes to your forked project with:
```
git push origin my-feature-branch
```

### Step 6: Create and submit a pull request
Go to your forked project on GitHub, select your feature branch and click the “Compare, review, create a pull request button”. After that, we will review your pull request in a few days (hopefully!), but if we delay please be patient :). We do our best in our spare time to keep the project updated, but unfortunately there may be some periods of time in which we simply can’t work in the project.



### License Agreement
By contributing your code, you agree to license your contribution under the terms of the [Apache 2.0 license](https://raw.githubusercontent.com/citiususc/hipster/4ca93e681ad7335acbd0bea9e49fe678d56f3519/LICENSE).

Also, remember to add this header to each new file that you’ve created:

```
/*
* Copyright 2015 Centro de Investigación en Tecnoloxías da Información (CITIUS), 
* University of Santiago de Compostela (USC).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
```

That’s all!


================================================
FILE: LICENSE
================================================
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 


================================================
FILE: README.md
================================================
![Hipster](src/main/doclava/custom/assets/hipster-template/assets/images/header-logo.png?raw=true)

![CI](https://github.com/citiususc/hipster/actions/workflows/maven.yml/badge.svg)
[![](https://jitpack.io/v/citiususc/hipster.svg)](https://jitpack.io/#citiususc/hipster)

A powerful and friendly heuristic search library implemented in Java.

## What's Hipster4j?

The aim of Hipster4j is to provide an easy to use yet powerful and flexible type-safe Java library for heuristic search. 
Hipster relies on a flexible model with generic operators that allow you to reuse and change the behavior of the algorithms very easily. Algorithms are also implemented in an iterative way, avoiding recursion. This has many benefits: full control over the search, access to the internals at runtime or a better and clear scale-out for large search spaces using the heap memory.

You can use Hipster4j to solve from simple graph search problems to more advanced state-space search problems where the state space is complex and weights are not just double values but custom defined costs.

## Features

The current version of the library comes with some very well-known and wide used search algorithms. We're working to add more algorithms soon:

* Search algorithms:
    * Uninformed search:
        * DFS: Depth-First-Search.
        * BFS: Breadth-First-Search.
        * Dijkstra's algorithm.
        * Bellman-Ford.
    * Informed search:
        * A star (A*).
        * IDA star (IDA*), Iterative Deepening A*.
        * AD star (AD*): Anytime Dynamic A*.
    * Local search:
        * Hill-Climbing.
        * Enforced-Hill-Climbing.
    * Multiobjective search
        * Multiobjective LS algorithm. Original paper: Martins, E. D. Q. V., & Santos, J. L. E. (1999). *"The labeling algorithm for the multiobjective shortest path problem"*. <i>Departamento de Matematica, Universidade de Coimbra, Portugal, Tech. Rep. TR-99/005</i> ([see an example](https://github.com/citiususc/hipster/wiki/Multiobjective-Search-with-Hipster-and-TinkerPop-Blueprints))
* 3rd party adapters:
    * [Java Universal/Graph (JUNG)](http://jung.sourceforge.net/) adapter.

If you don't find the algorithm or the feature you are looking for, please consider contributing to Hipster!. You can open a new issue or better fork this repository and create a pull request with your contribution.

## Getting started

The easiest way to use Hipster is adding it as a dependency with your favourite dependency manager.
Maven users can include the library using the following snippet:

#### Snapshots

You can use the latest (unstable) version of Hipster under development. Just add the following dependency into your pom.xml:

```xml
<!-- Use sonatype oss public for snapshots -->
<repositories>
  <repository>
    <id>sonatype-oss-public</id>
    <url>https://oss.sonatype.org/content/groups/public/</url>
    <snapshots>
      <enabled>true</enabled>
    </snapshots>
  </repository>
</repositories>

<dependencies>
  <!-- 
    Add this dependency under your pom.xml <dependencies> section to add
    all the dependencies of Hipster to your project. Add hipster-core
    instead of hipster-all for basic functionality.
  -->
  <dependency>
    <groupId>es.usc.citius.hipster</groupId>
    <artifactId>hipster-all</artifactId>
    <version>1.0.2-SNAPSHOT</version>
  </dependency>
</dependencies>
```

#### Releases

Current stable release is v1.0.1. See the [milestones](https://github.com/citiususc/hipster/milestones) to check the current development status.

```xml
<dependencies>
  <!--
    Add this dependency under your pom.xml <dependencies> section to add
    all the dependencies of Hipster to your project. Add hipster-core
    instead of hipster-all for core functionality.
  -->
  <dependency>
    <groupId>es.usc.citius.hipster</groupId>
    <artifactId>hipster-all</artifactId>
    <version>1.0.1</version>
  </dependency>
</dependencies>
```

#### Quick Example

Let's solve the graph used in [this Wikipedia article](http://en.wikipedia.org/wiki/Shortest_path_problem)
about Shortest paths.

![DirectedGraph](http://upload.wikimedia.org/wikipedia/commons/thumb/3/3b/Shortest_path_with_direct_weights.svg/512px-Shortest_path_with_direct_weights.svg.png)

Although Hipster is graph agnostic, we include some useful classes to create a graph or a
directed graph and the search problem. We create a graph using the GraphBuilder class and then
we use the GraphSearchProblem to create the required components to solve it using Dijkstra's algorithm:

```java
// Create a simple weighted directed graph with Hipster where
// vertices are Strings and edge values are just doubles
HipsterDirectedGraph<String,Double> graph = 
    GraphBuilder.<String,Double>create()
     .connect("A").to("B").withEdge(4d)
     .connect("A").to("C").withEdge(2d)
     .connect("B").to("C").withEdge(5d)
     .connect("B").to("D").withEdge(10d)
     .connect("C").to("E").withEdge(3d)
     .connect("D").to("F").withEdge(11d)
     .connect("E").to("D").withEdge(4d)
     .createDirectedGraph();

// Create the search problem. For graph problems, just use
// the GraphSearchProblem util class to generate the problem with ease.
SearchProblem p = GraphSearchProblem
                           .startingFrom("A")
                           .in(graph)
                           .takeCostsFromEdges()
                           .build();
                           
// Search the shortest path from "A" to "F"
System.out.println(Hipster.createDijkstra(p).search("F"));
```

Output result:
`Total solutions: 1
Total time: 6 ms
Total number of iterations: 6
+ Solution 1: 
 - States: 
	[A, C, E, D, F]
 - Actions: 
	[2.0, 3.0, 4.0, 11.0]
 - Search information: 
	WeightedNode{state=F, cost=20.0, estimation=0.0, score=20.0}`

But that's not all. Hipster comes with different problem examples
that illustrate how Hipster can be used to solve a [wide variety of problems](https://github.com/citiususc/hipster/tree/0c0ec9cb5087fede9930a6efbd5126afd69896ac/hipster-examples/src/main/java/es/usc/citius/hipster/examples) (not only graph search).

## What's next?

If you want to learn how to solve a problem by searching with Hipster, check the [wiki](https://github.com/citiususc/hipster/wiki) and the [JavaDoc documentation](http://www.hipster4j.org/hipster-javadocs).
We also suggest you to check [this presentation](https://speakerdeck.com/pablormier/hipster-an-open-source-java-library-for-heuristic-search) for a quick introduction.

## License & Citation

This software is licensed under the Apache 2 license, quoted below.

    Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS),
    University of Santiago de Compostela (USC).

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    
    

### Citation

This library was presented in the "9th Iberian Conference on Information Systems and Technologies (CISTI), 2014". If you use this library in your research projects, we encourage you to please cite our work: 

> Rodriguez-Mier, P., Gonzalez-Sieira, A., Mucientes, M., Lama, M. & Bugarin, A. (2014). **Hipster: An Open Source Java Library for Heuristic Search**. _9th Iberian Conference on Information Systems and Technologies (CISTI)_.

```
@inproceedings{RodriguezMier2014,
  author = {Rodriguez-Mier, Pablo and Gonzalez-Sieira, Adrian and Mucientes, Manuel and and Lama, Manuel and Bugarin, Alberto},
  booktitle = {9th Iberian Conference on Information Systems and Technologies (CISTI 2014)},
  month = jun,
  volume = 1,
  title = {{Hipster: An Open Source Java Library for Heuristic Search}},
  pages = {481--486},
  isbn = "978-989-98434-2-4"
  address = "Barcelona",
  year = {2014}
}
```


================================================
FILE: hipster-all/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.
  ~
  ~    Licensed under the Apache License, Version 2.0 (the "License");
  ~    you may not use this file except in compliance with the License.
  ~    You may obtain a copy of the License at
  ~
  ~        http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~    Unless required by applicable law or agreed to in writing, software
  ~    distributed under the License is distributed on an "AS IS" BASIS,
  ~    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~    See the License for the specific language governing permissions and
  ~    limitations under the License.
  -->

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <groupId>es.usc.citius.hipster</groupId>
        <artifactId>hipster-pom</artifactId>
        <version>1.0.2-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>hipster-all</artifactId>

    <properties>
        <hipster.root.dir>${project.basedir}/..</hipster.root.dir>
    </properties>

    <dependencies>
        <dependency>
            <groupId>es.usc.citius.hipster</groupId>
            <artifactId>hipster-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>es.usc.citius.hipster</groupId>
            <artifactId>hipster-examples</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>es.usc.citius.hipster</groupId>
            <artifactId>hipster-test</artifactId>
            <version>${project.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <finalName>${project.artifactId}-${project.version}-all</finalName>
                    <appendAssemblyId>false</appendAssemblyId>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

================================================
FILE: hipster-all/src/main/java/es/usc/citius/hipster/all/package-info.java
================================================
/*
 * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS), University of Santiago de Compostela (USC).
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

/**
 *
 */
package es.usc.citius.hipster.all;

================================================
FILE: hipster-core/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <groupId>es.usc.citius.hipster</groupId>
        <artifactId>hipster-pom</artifactId>
        <version>1.0.2-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>hipster-core</artifactId>

    <properties>
        <hipster.root.dir>${project.basedir}/..</hipster.root.dir>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

</project>

================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/ADStarForward.java
================================================
/*
* Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS), University of Santiago de Compostela (USC).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package es.usc.citius.hipster.algorithm;

import es.usc.citius.hipster.model.Transition;
import es.usc.citius.hipster.model.function.impl.*;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Queue;

/**
 * <p>Iterative implementation of the forward Anytime Dynamic A* (AD*-f) search algorithm.</p>
 *
 * <p>AD* is an anytime, dynamic search algorithm. It is able to obtain suboptimal-bounded solutions,
 * tuning the quality of the solution based on the available search time (this is done by adjusting
 * the heuristic inflation parameter, epsilon). This algorithm is executed
 * iteratively improving the quality of the solution and reusing previous search efforts. The algorithm
 * also takes into account the changes produced over the graph arc costs to incrementally repair
 * the previous solution. AD* provides anytime results and an efficient
 * way to solve dynamic search problems.</p>
 *
 * <p>This is the forward implementation of AD*, the algorithm starts exploring the state space
 * from the beginning state and trying to reach a goal state (or multiple ones).</p>
 *
 * <p><u>Reference</u>:
 * </br>Maxim Likhachev, David Ferguson, Geoffrey Gordon, Anthony (Tony) Stentz, and Sebastian Thrun,
 * <b><a href="http://www-cgi.cs.cmu.edu/afs/cs.cmu.edu/Web/People/maxim/files/ad_icaps05.pdf">
 * "Anytime Dynamic A*: An Anytime, Replanning Algorithm"</a></b>
 * <i>Proceedings of the International Conference on Automated Planning and Scheduling (ICAPS), June, 2005.</i></p>
 *
 * @param <A> class defining the action
 * @param <S> class defining the state
 * @param <C> class defining the cost, must implement {@link java.lang.Comparable}
 * @param <N> type of the nodes
 *
 * @author Adrián González Sieira <<a href="adrian.gonzalez@usc.es">adrian.gonzalez@usc.es</a>>
 */
public class ADStarForward<A,S,C extends Comparable<C>, N extends es.usc.citius.hipster.model.ADStarNode<A, S, C, N>> extends Algorithm<A, S, N> {

    protected S begin;
    protected Collection<S> goals;
    protected ADStarNodeExpander<A, S, C, N> expander;

    /**
     * Create an instance of the algorithm with a begin, a goal and a component to
     * expand new nodes from the current one.
     *
     * @param begin begin state
     * @param goal goal state
     * @param expander component which generates new nodes from the current
     */
    public ADStarForward(S begin, S goal, ADStarNodeExpander<A, S, C, N> expander) {
        this(begin, Collections.singleton(goal), expander);
    }

    /**
     * Create an instance of the algorithm with a begin, multiple goals and a component to
     * expand new nodes from the current one.
     *
     * @param begin begin state
     * @param goals collection of goal states
     * @param expander component which generates new nodes from the current
     */
    public ADStarForward(S begin, Collection<S> goals, ADStarNodeExpander<A, S, C, N> expander) {
        this.begin = begin;
        this.goals = goals;
        this.expander = expander;
    }

    @Override
    public Iterator iterator() {
        return new Iterator();
    }

    /**
     * Internal iterator that implements all the logic of the A* search
     */
    public class Iterator implements java.util.Iterator<N> {
        //queues used by the algorithm
        protected Map<S, N> open;
        protected Map<S, N> closed;
        protected Map<S, N> incons;
        protected Collection<Transition<A, S>> transitionsChanged;
        protected Queue<N> queue;
        protected boolean replan;
        protected final N beginNode;
        protected final Collection<N> goalNodes;

        protected Iterator() {
            this.replan = false;
            //initialize nodes
            this.beginNode = expander.makeNode(null, new Transition<A, S>(null, begin));
            //initialize goal node collection
            this.goalNodes = new ArrayList<N>(goals.size());
            //iterate over the set of goals
            for(S current : goals){
                //create new node for current goal
                this.goalNodes.add(expander.makeNode(beginNode, new Transition<A, S>(null, current)));
            }
            //initialize queues of the algorithm
            this.open = new HashMap<S, N>();
            this.closed = new HashMap<S, N>();
            this.incons = new HashMap<S, N>();
            this.queue = new PriorityQueue<N>();
            //initialize list of visited nodes
            expander.clearVisited();
            //initialize set of changed transitions
            this.transitionsChanged = new HashSet<Transition<A, S>>();
            //mark begin node as visited by the algorithm
            expander.getVisited().put(beginNode.state(), beginNode);
            //mark goal nodes as visited
            for(N current : goalNodes){
                //mark current current as visited by the algorithm
                expander.getVisited().put(current.state(), current);
            }
            //insert beginning node at OPEN
            insertOpen(beginNode);
        }

        /**
         * Inserts a node in the open queue.
         *
         * @param node instance of node to add
         */
        protected void insertOpen(N node) {
            this.open.put(node.state(), node);
            this.queue.offer(node);
        }

        /**
         * Retrieves the most promising node from the open collection, or null if it
         * is empty.
         *
         * @return most promising node
         */
        protected N takePromising() {
            while (!queue.isEmpty()) {
                N head = queue.peek();
                if (!open.containsKey(head.state())) {
                    queue.poll();
                } else {
                    return head;
                }
            }
            return null;
        }

        /**
         * Updates the membership of the node to the algorithm queues.
         *
         * @param node instance of node
         */
        protected void updateQueues(N node) {
            S state = node.state();
            if (node.getV().compareTo(node.getG()) != 0) {
                if (!this.closed.containsKey(state)) {
                    insertOpen(node);
                } else {
                    this.incons.put(state, node);
                }
            } else {
                this.open.remove(state);
                //this.queue.remove(node);
                this.incons.remove(state);
            }
            //remove flag to update queues
            node.setDoUpdate(false);
        }

        /**
         * The iterator will have next() nodes when the stop condition of the algorithm is not reached, or if the
         * value of Epsilon has changed and a replanning is needed. It may happen that after chaning Epsilon the
         * solution does not improve, and therefore this method will return false. In that case, Epsilon should be
         * reduced again until the minimum value of 1 is reached. In that case, the solution will be optimal.
         *
         * @see #setEpsilon(double)
         *
         * @return true if a replan is pending or the solution has not been found
         */
        @Override
        public boolean hasNext() {
            N current = takePromising();
            N minGoal = Collections.min(goalNodes);
            return replan || this.open.containsKey(minGoal.state()) || minGoal.compareTo(current) >= 0 || minGoal.getV().compareTo(minGoal.getG()) < 0;
        }

        /**
         * Removing is not supported.
         */
        @Override
        public void remove() {
            throw new UnsupportedOperationException();
        }

        @Override
        public N next() {
            //First node in OPEN retrieved, not removed
            N current = takePromising();
            S state = current.state();
            N minGoal = Collections.min(goalNodes);
            if (minGoal.compareTo(current) >= 0 || minGoal.getV().compareTo(minGoal.getG()) < 0) {
                //s removed from OPEN
                open.remove(state);
                //this.queue.remove(current);
                //if v(s) > g(s)
                boolean consistent = current.isConsistent();
                if (consistent) {
                    //v(s) = g(s)
                    current.setV(current.getG());
                    //closed = closed U current
                    closed.put(state, current);
                } else {
                    //v(s) = Infinity
                    expander.setMaxV(current);
                    updateQueues(current);
                }
                expander.setNodeConsistent(consistent);
                //expand successors
                for (N successorNode : expander.expand(current)) {
                    if(successorNode.isDoUpdate()){
                        updateQueues(successorNode);
                    }
                }
            } else {
                this.replan = false;
                // for all directed edges (u, v) with changed edge costs
                for(N nodeTransitionsChanged : expander.expandTransitionsChanged(beginNode, transitionsChanged)){
                    updateQueues(nodeTransitionsChanged);
                }
                //empty the list of transitions
                transitionsChanged.clear();
                //move states from INCONS to OPEN
                open.putAll(incons);
                //empty INCONS queue
                incons.clear();
                //updateQueues the priorities for all s in OPEN according to key(s)
                queue.clear();
                for(N node : open.values()){
                    //key is recalculated according to the new value of Epsilon
                    expander.updateKey(node);
                    //insert into the priority queue
                    queue.offer(node);
                }
                //closed = empty
                closed.clear();
                current = takePromising();
            }
            return current;
        }

        /**
         * AD* uses the OPEN queue to order the most promising nodes to be expanded by the
         * algorithm. This method retrieves the original map (not a copy) that contains
         * the pairs of <State, Node>
         *
         * @return open map with the unexplored nodes and states.
         */
        public Map<S, N> getOpen() { return open; }

        /**
         * Get the internal map used by the algorithm to keep the relations between
         * explored states and nodes. Modifications to the map can alter the normal
         * function of the algorithm.
         *
         * @return closed map with the explored nodes and states
         */
        public Map<S, N> getClosed() { return closed; }

        public Map<S, N> getIncons() { return incons; }

        /**
         * Retrieves the list of goal nodes for its modification.
         *
         * @return list of goals
         */
        public Collection<N> getGoalNodes() {
            return goalNodes;
        }

        /**
         * Updates the value of epsilon to improve the cost of the solutions.
         * The update of Epsilon must be manually done, as this parameter higlhy depends on the heuristic used,
         * and the search problem. Use only values of epsilon above 1, as the opposite will lead to diminish the
         * estimate of the heuristic, which is supposed to be optimistic. Values below 1 result in underestimating
         * the cost to the goal, and therefore in a greater number of expansions to find the same solution than with
         * epsilon = 1.
         *
         * @param epsilon new value of epsilon (sub-optimal bound to obtain anytime solutions)
         */
        public void setEpsilon(double epsilon){
            this.replan = true;
            expander.setEpsilon(epsilon);
        }

        /**
         * Queries the current value of Epsilon (sub-optimal bound for anytime solutions).
         *
         * @return current value of Epsilon
         */
        public double getEpsilon(){
            return expander.getEpsilon();
        }

        /**
         * Marks transitions to be processed in the next replan event.
         *
         * @param transitions
         */
        public void addTransitionsChanged(Collection<Transition<A, S>> transitions){
            this.replan = true;
            transitionsChanged.addAll(transitions);
        }
    }

}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/AStar.java
================================================
/*
 * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package es.usc.citius.hipster.algorithm;

import es.usc.citius.hipster.model.HeuristicNode;
import es.usc.citius.hipster.model.function.NodeExpander;

import java.util.*;

/**
 * <p>
 * Implementation of the A* algorithm. The A* algorithm extends the original
 * Dijkstra's algorithm by including heuristics to improve the search. By default,
 * the implementation uses a {@link java.util.PriorityQueue} for the nodes, which requires
 * {@literal O(log n)} time for insertions. The queue can be changed to use another
 * type of queue, for example a fibonacci heap as a queue, which works with constant amortized
 * time for insertions.
 * </p>
 *
 * <a href="http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=4082128">Original paper</a>:
 * Hart, Peter E., Nils J. Nilsson, and Bertram Raphael. <b>"A formal basis for the heuristic determination of minimum cost paths."</b>. <i>IEEE Transactions on Systems Science and Cybernetics 4.2 (1968): 100-107</i>.
 *
 * @param <A> action type.
 * @param <S> state type.
 * @param <C> comparable cost used to compare states.
 * @param <N> type of the heuristic search node used.
 *
 * @author Pablo Rodríguez Mier <<a href="mailto:pablo.rodriguez.mier@usc.es">pablo.rodriguez.mier@usc.es</a>>
 */
public class AStar<A,S,C extends Comparable<C>,N extends HeuristicNode<A,S,C,N>> extends Algorithm<A,S,N> {

    protected final N initialNode;
    protected final NodeExpander<A,S,N> expander;

    /**
     * Default constructor for ADStarForward. Requires the initial state, the successor function to generate
     * the neighbor states of a current one and the factory to instantiate new nodes.
     *
     * @param initialNode the initial node (which contains the initial state of the search).
     * @param expander function to obtain (expand) a node to obtain the successor nodes.
     */
    public AStar(N initialNode, NodeExpander<A,S,N> expander) {
        this.initialNode = initialNode;
        this.expander = expander;
    }

    @Override
    public Iterator iterator() {
        return new Iterator();
    }

    /**
     * Internal iterator that implements all the logic of the A* search
     */
    public class Iterator implements java.util.Iterator<N> {
        protected Map<S, N> open;
        protected Map<S, N> closed;
        protected Queue<N> queue;

        protected Iterator() {
            open = new HashMap<S, N>();
            closed = new HashMap<S, N>();
            queue = new PriorityQueue<N>();
            queue.add(initialNode);
            open.put(initialNode.state(), initialNode);
        }

        /**
         * Returns true if open queue is not empty.
         */
        public boolean hasNext() {
            return !open.values().isEmpty();
        }

        protected N takePromising() {
            // Poll until a valid state is found
            N node = queue.poll();
            while (!open.containsKey(node.state())) {
                node = queue.poll();
            }
            return node;
        }

        /**
         * Calculates the next visited state. Each state contains the information of the partial path
         * explored. To check if the state is the goal state, just check the corresponding node of
         * the state with {@code currentNode.transition().to().equals(myGoalState)}
         *
         * @return next visited state.
         */
        public N next() {
            // Get and remove the best node in the queue
            N current = takePromising();
            S currentState = current.state();
            // Remove from open as well
            open.remove(currentState);

            // Analyze the cost of each movement from the current node
            for(N successorNode : expander.expand(current)){
                N successorOpen = open.get(successorNode.state());
                if (successorOpen != null) {
                    if (successorOpen.getScore().compareTo(successorNode.getScore()) <= 0) {
                        // Keep analyzing the other movements, discard this movement
                        continue;
                    }
                }

                N successorClose = closed.get(successorNode.state());
                if (successorClose != null) {
                    // Check if this path improves the cost of a closed neighbor.
                    if (successorClose.getScore().compareTo(successorNode.getScore()) <= 0) {
                        continue;
                    }
                }

                // In any other case, add the new successor to the open list to explore later
                open.put(successorNode.state(), successorNode);
                queue.add(successorNode);
            }
            // Once analyzed, the current node moves to the closed list
            closed.put(currentState, current);
            return current;
        }

        /**
         * Remove is not supported
         */
        public void remove() {
            throw new UnsupportedOperationException();
        }

        /**
         * Get the internal map used by the algorithm to keep the relations between
         * unexplored states and nodes. The map returned is the original copy. Modifications to
         * the map can alter the normal function of the algorithm.
         *
         * @return open map with the unexplored nodes and states.
         */
        public Map<S, N> getOpen() {
            return open;
        }

        public void setOpen(Map<S, N> open) {
            this.open = open;
        }

        /**
         * Get the internal map used by the algorithm to keep the relations between
         * explored states and nodes. Modifications to the map can alter the normal
         * function of the algorithm.
         *
         * @return closed map with the explored nodes and states
         */
        public Map<S, N> getClosed() {
            return closed;
        }

        /**
         * Replace the original close map with the provided one. Modifications to the close map
         * can cause malfunction. Use only for optimization purposes.
         *
         * @param closed internal close map.
         */
        public void setClosed(Map<S, N> closed) {
            this.closed = closed;
        }

        /**
         * Returns the original queue used by the algorithm to sort the unexplored
         * nodes. The original queue is a java {@code PriorityQueue}. External modifications
         * to the queue can cause malfunction. This method can be used for example to check
         * the size of the queue during the search or to implement low level optimizations.
         *
         * @return original copy of the internal queue.
         */
        public Queue<N> getQueue() {
            return queue;
        }

        /**
         * Replace the original open map with the provided one. Modifications to the open map
         * can cause malfunction. Use only for optimization purposes.
         *
         * @param queue internal open map.
         */
        public void setQueue(Queue<N> queue) {
            this.queue = queue;
        }
    }
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/Algorithm.java
================================================
/*
 * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package es.usc.citius.hipster.algorithm;


import es.usc.citius.hipster.model.Node;
import es.usc.citius.hipster.util.Predicate;

import java.util.*;

/**
 * Abstract class implemented by each search algorithm. This class provides basic methods
 * to each algorithm for searching or printing detailed information about the search.
 *
 * @param <A> type of the actions ({@code Void} if actions are not explicit).
 * @param <S> type of the states.
 * @param <N> type of the nodes.
 *
 * @author Pablo Rodríguez Mier <<a href="mailto:pablo.rodriguez.mier@usc.es">pablo.rodriguez.mier@usc.es</a>>
 */
public abstract class Algorithm<A,S,N extends Node<A,S,N>> implements Iterable<N> {


    /**
     * Holds information about the search process.
     */
    public final class SearchResult {
        private int iterations;
        private Collection<N> goalNodes;
        private long elapsed;


        public SearchResult(N goalNode, int iterations, long elapsed) {
            this.goalNodes = Collections.singletonList(goalNode);
            this.iterations = iterations;
            this.elapsed = elapsed;
        }

        public SearchResult(Collection<N> goalNodes, int iterations, long elapsed) {
            this.goalNodes = goalNodes;
            this.iterations = iterations;
            this.elapsed = elapsed;
        }

        /**
         * @return the elapsed time (in milliseconds) between the begin of the search and the
         * search result generation.
         */
        public long getElapsed() {
            return elapsed;
        }

        /**
         * Number of iterations performed by the search algorithm.
         * @return number of iterations.
         */
        public int getIterations() {
            return iterations;
        }

        /**
         * @return goal node.
         */
        public N getGoalNode() {
            return goalNodes.iterator().next();
        }

        public Collection<N> getGoalNodes() {
            return goalNodes;
        }

        public List<List<S>> getOptimalPaths() {
            List<List<S>> paths = new ArrayList<List<S>>(goalNodes.size());
            for(N goalNode : goalNodes){
                paths.add(recoverStatePath(goalNode));
            }

            return paths;
        }

        @Override
        public String toString() {
            final String ls = System.getProperty("line.separator");
            StringBuilder builder = new StringBuilder();
            builder.append("Total solutions: ").append(goalNodes.size()).append(ls);
            builder.append("Total time: ").append(getElapsed()).append(" ms").append(ls);
            builder.append("Total number of iterations: ").append(getIterations()).append(ls);
            // Take solutions
            int solution=1;
            for(N goalNode : goalNodes){
                builder.append("+ Solution ").append(solution).append(": ").append(ls);
                builder.append(" - States: ").append(ls);
                builder.append("\t").append(recoverStatePath(goalNode).toString()).append(ls);
                builder.append(" - Actions: ").append(ls);
                builder.append("\t").append(recoverActionPath(goalNode).toString()).append(ls);
                builder.append(" - Search information: ").append(ls);
                builder.append("\t").append(goalNode.toString()).append(ls);
                solution++;
            }
            return builder.toString();
        }
    }

    public interface SearchListener<N> {
        void handle(N node);
    }

    /**
     * Run the algorithm until the goal is found or no more states are
     * available.
     * @return SearchResult with the information of the search
     */
    public SearchResult search(final S goalState){
        return search(new Predicate<N>() {
            @Override
            public boolean apply(N n) {
                if (goalState != null) {
                    return n.state().equals(goalState);
                }
                return false;
            }
        });
    }


    /**
     * Executes the search algorithm until the predicate condition is
     * satisfied or there are no more nodes to explore.
     *
     * @param condition predicate with the boolean condition.
     * @return {@link es.usc.citius.hipster.algorithm.Algorithm.SearchResult with information about the search}
     */
    public SearchResult search(Predicate<N> condition){
        int iteration = 0;
        Iterator<N> it = iterator();
        long begin = System.currentTimeMillis();
        N currentNode = null;
        while(it.hasNext()){
            iteration++;
            currentNode = it.next();
            if (condition.apply(currentNode)) {
                break;
            }

        }
        long end = System.currentTimeMillis();
        return new SearchResult(currentNode, iteration, end - begin);
    }

    /**
     * <p>
     * Executes the search algorithm and invokes the method
     * {@link SearchListener#handle(Object)} passing the current
     * explored node to the listener.
     * </p>
     *
     * <pre class="prettyprint">
     *  {@code Hipster.createDijkstra(problem).search(new Algorithm.SearchListener() {
     *      @Override
     *          public void handle(Node node) {
     *              // Do something with the node.
     *          }
     *      });
     *  }
     * </pre>
     *
     * @param listener listener used to receive the explored nodes.
     */
    public void search(SearchListener<N> listener){
        Iterator<N> it = iterator();
        while(it.hasNext()){
            listener.handle(it.next());
        }
    }

    /**
     * Returns a path with all the states of the path.
     *
     * @param <S> type of the state.
     * @param <N> type of the node.
     * @return a list with the states of the path, from the initial state
     * to the state of the provided node ({@link es.usc.citius.hipster.model.Node#state()}).
     */
    public static <S, N extends Node<?,S,N>>  List<S> recoverStatePath(N node){
        List<S> states = new LinkedList<S>();
        for(N n : node.path()){
            states.add(n.state());
        }
        return states;
    }

    /**
     * Returns a path of the actions applied from the initial state
     * to the state of the provided node ({@link es.usc.citius.hipster.model.Node#state()}).
     *
     * @param <A> type of the actions.
     * @param <N> type of the nodes.
     * @return list with the ordered actions.
     */
    public static <A, N extends Node<A,?,N>>  List<A> recoverActionPath(N node){
        List<A> actions = new LinkedList<A>();
        for(N n : node.path()){
            if (n.action() != null) actions.add(n.action());
        }
        return actions;
    }
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/BellmanFord.java
================================================
/*
 * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package es.usc.citius.hipster.algorithm;

import es.usc.citius.hipster.model.CostNode;
import es.usc.citius.hipster.model.function.NodeExpander;
import es.usc.citius.hipster.util.Predicate;
import es.usc.citius.lab.hipster.collections.HashQueue;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Queue;

/**
 * <p>
 * Optimized implementation of the Bellman-Ford algorithm. The main difference with the standard version
 * of Bellman-Ford is that this implementation does not relax all edges at each iteration. This implies that
 * the first time the goal state is reached, the cost may not be the optimal one. The optimal cost is only guaranteed
 * when the queue is empty (when bellmanFordIt.hasNext() == false).
 * </p>
 *
 * <a href="http://www.ams.org/mathscinet-getitem?mr=0102435">Original paper</a>:
 * Bellman, R. <b>"On a routing problem"</b>. <i>Quarterly of Applied Mathematics (1958) 16: 87–90</i>.
 *
 * @param <A> action type.
 * @param <S> state type.
 * @param <C> comparable cost used to compare states.
 * @param <N> type of the heuristic search node used.
 *
 * @author Pablo Rodríguez Mier <<a href="mailto:pablo.rodriguez.mier@usc.es">pablo.rodriguez.mier@usc.es</a>>
 */
public class BellmanFord<A,S,C extends Comparable<C>,N extends CostNode<A,S,C,N>> extends Algorithm<A,S,N> {
    protected N initialNode;
    protected NodeExpander<A,S,N> nodeExpander;
    protected boolean checkNegativeCycles = true;

    public BellmanFord(N initialNode, NodeExpander<A, S, N> nodeExpander) {
        this.initialNode = initialNode;
        this.nodeExpander = nodeExpander;
    }

    /**
     * Bellman-Ford iterator. Each invocation to {@code next()} returns the
     * next expanded node with the approximated cost. The cost is only optimal
     * when the queue is fully processed.
     */
    public class Iterator implements java.util.Iterator<N> {
        protected Queue<S> queue;
        protected Map<S, N> explored;

        protected Iterator(){
            this.queue = new HashQueue<S>();
            this.explored = new HashMap<S, N>();
            this.queue.add(initialNode.state());
            this.explored.put(initialNode.state(), initialNode);
        }

        /**
         * Assigns a node to the processing queue and adds it to the
         * explored set of nodes.
         *
         * @param node node to update the queue status
         */
        protected void enqueue(N node) {
            S state = node.state();
            if (!this.queue.contains(state)) {
                this.queue.add(state);
            }
            this.explored.put(state, node);
        }

        /**
         * Removes the head of the processing queue and
         * returns the corresponding node.
         *
         * @return node of the processing queue head
         */
        protected N dequeue() {
            S state = this.queue.poll();
            return this.explored.get(state);
        }


        @Override
        public boolean hasNext() {
            return !queue.isEmpty();
        }

        @Override
        public N next() {
            // Take the next node
            N currentNode = dequeue();
            if (checkNegativeCycles && currentNode.pathSize() > explored.size()){
                throw new NegativeCycleException();
            }
            for (N successor : nodeExpander.expand(currentNode)) {
                // Check if there is any improvement in the old cost
                N previousNode = this.explored.get(successor.state());
                if (previousNode != null) {
                    // Check both paths. If the new path is better than the previous
                    // path, update and enqueue. Else, discard this node.
                    //if (comparator.compare(successorNode, previousNode) <= 0){
                    if (successor.getCost().compareTo(previousNode.getCost()) < 0) {
                        // Replace the worst version and re-enqueue (if not in queue)
                        enqueue(successor);
                    }
                } else {
                    enqueue(successor);
                }
            }
            return currentNode;
        }

        @Override
        public void remove() {
            throw new UnsupportedOperationException();
        }
    }

    @Override
    public SearchResult search(Predicate<N> condition){
        int iteration = 0;
        Iterator it = iterator();
        long begin = System.currentTimeMillis();
        N currentNode = null;
        N goalNode = null;
        while(it.hasNext()){
            iteration++;
            currentNode = it.next();
            if (goalNode == null && condition.apply(currentNode)) {
                goalNode = currentNode;
            }
        }
        long end = System.currentTimeMillis();
        if (goalNode != null) {
            N goal = it.explored.get(goalNode.state());
            return new SearchResult(goal, iteration, end - begin);
        }

        return new SearchResult(Collections.<N>emptyList(), iteration, end - begin);
    }

    @Override
    public Iterator iterator() {
        return new Iterator();
    }

    public N getInitialNode() {
        return initialNode;
    }

    public void setInitialNode(N initialNode) {
        this.initialNode = initialNode;
    }

    public NodeExpander<A, S, N> getNodeExpander() {
        return nodeExpander;
    }

    public void setNodeExpander(NodeExpander<A, S, N> nodeExpander) {
        this.nodeExpander = nodeExpander;
    }

    public boolean isCheckNegativeCycles() {
        return checkNegativeCycles;
    }

    public void setCheckNegativeCycles(boolean checkNegativeCycles) {
        this.checkNegativeCycles = checkNegativeCycles;
    }
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/BreadthFirstSearch.java
================================================
/*
 * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package es.usc.citius.hipster.algorithm;

import es.usc.citius.hipster.model.Node;
import es.usc.citius.hipster.model.function.NodeExpander;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.Queue;

/**
 * <p>
 * Breadth First Search (BFS) implementation. This is an uninformed algorithm that explores
 * first the neighbors at distance 1 (direct neighbors), then the neighbors at distance 2
 * (neighbors of the neighbors), and so on. The algorithm is complete but not optimal
 * (it is only optimal if the cost of the problem is uniform and each transition has a cost of one).
 * </p>
 *
 * See this <a href="http://en.wikipedia.org/wiki/Breadth-first_search">Wikipedia article</a> for more information about BFS.
 *
 * @param <A> action type.
 * @param <S> state type.
 * @param <N> type of the heuristic search node used.
 */
public class BreadthFirstSearch<A,S,N extends Node<A,S,N>> extends Algorithm<A,S,N> {
    protected final N initialNode;
    protected final NodeExpander<A,S,N> expander;

    public BreadthFirstSearch(N initialNode, NodeExpander<A, S, N> expander) {
        this.initialNode = initialNode;
        this.expander = expander;
    }

    /**
     * Implements all the BFS search logic as an iterator
     */
    public class Iterator implements java.util.Iterator<N> {
        protected Queue<N> queue = new LinkedList<N>();
        protected Map<S, N> visited = new HashMap<S, N>();

        /**
         * Iterator cannot be instantiated from outside.
         * Use {@link BreadthFirstSearch#iterator()} to create a new BFS iterator.
         */
        protected Iterator(){
            visited.put(initialNode.state(), initialNode);
            queue.add(initialNode);
        }

        @Override
        public boolean hasNext() {
            return !queue.isEmpty();
        }

        @Override
        public N next() {
            // Take next node
            N current = queue.poll();
            for(N successorNode : expander.expand(current)){
                if (!visited.containsKey(successorNode.state())){
                    visited.put(successorNode.state(), successorNode);
                    queue.add(successorNode);
                }
            }
            return current;
        }

        @Override
        public void remove() {
            throw new UnsupportedOperationException();
        }

        /* Access methods to the internals of the iterator */

        public Queue<N> getQueue() {
            return queue;
        }

        public void setQueue(Queue<N> queue) {
            this.queue = queue;
        }

        public Map<S, N> getVisited() {
            return visited;
        }

        public void setVisited(Map<S, N> visited) {
            this.visited = visited;
        }
    }

    @Override
    public Iterator iterator() {
        return new Iterator();
    }
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/DepthFirstSearch.java
================================================
/*
 * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package es.usc.citius.hipster.algorithm;

import es.usc.citius.hipster.model.Node;
import es.usc.citius.hipster.model.function.NodeExpander;

import java.util.*;

/**
 * <p>
 * Depth First Search (DFS) is a blind algorithm that performs an exploration
 * of the graph in a way that always reaches the deepest node before backtracking.
 * The Hipster implementation is a graph-based search that can handle cycles.
 * This algorithm is complete (it always finds a solution if it exists) but not
 * optimal.
 * </p>
 *
 * For more information see <a href="http://en.wikipedia.org/wiki/Depth-first_search">this article of the Wikipedia</a> about DFS.
 *
 * @author Pablo Rodríguez Mier <<a href="mailto:pablo.rodriguez.mier@usc.es">pablo.rodriguez.mier@usc.es</a>>
 */
public class DepthFirstSearch<A,S,N extends Node<A,S,N>> extends Algorithm<A,S,N> {
    protected N initialNode;
    protected NodeExpander<A,S,N> expander;

    // TODO; DRY common structures with other algorithms (like IDA)

    public DepthFirstSearch(N initialNode, NodeExpander<A, S, N> expander) {
        this.expander = expander;
        this.initialNode = initialNode;
    }

    public class StackFrameNode {
        // Iterable used to compute neighbors of the current node
        private java.util.Iterator<N> successors;
        // Current search node
        private N node;
        // Boolean value to check if the node is still unvisited
        // in the stack or not
        boolean visited = false;
        // Boolean to indicate that this node is fully processed
        boolean processed = false;

        StackFrameNode(java.util.Iterator successors, N node) {
            this.successors = successors;
            this.node = node;
        }

        StackFrameNode(N node) {
            this.node = node;
            this.successors = expander.expand(node).iterator();
        }

        public N getNode() {
            return node;
        }

        public java.util.Iterator<N> getSuccessors() {
            return successors;
        }

        public boolean isVisited() {
            return visited;
        }

        public boolean isProcessed() {
            return processed;
        }
    }

    /**
     * DFS iterator used to expand always the deepest non-visited node.
     */
    public class Iterator implements java.util.Iterator<N> {
        protected Deque<StackFrameNode> stack = new ArrayDeque<StackFrameNode>();
        protected StackFrameNode next;
        protected Set<S> closed = new HashSet<S>();
        protected boolean graphSupport = true;

        protected Iterator(){
            this.stack.addLast(new StackFrameNode(initialNode));
        }


        @Override
        public boolean hasNext() {
            if (next == null){
                // Compute next
                next = nextUnvisited();
                if (next == null) return false;
            }
            return true;
        }

        @Override
        public N next(){
            if (next != null){
                StackFrameNode e = next;
                // Compute the next one
                next = null;
                // Return current node
                return e.node;
            }
            // Compute next
            StackFrameNode nextUnvisited = nextUnvisited();
            if (nextUnvisited!=null){
                return nextUnvisited.node;
            }
            return null;

        }

        @Override
        public void remove() {
            throw new UnsupportedOperationException();
        }


        protected StackFrameNode nextUnvisited(){
            StackFrameNode nextNode;
            do {
                nextNode = processNextNode();
            } while(nextNode != null && (nextNode.processed || nextNode.visited || closed.contains(nextNode.node.state())));

            if (nextNode != null){
                nextNode.visited = true;
                // For graphs, the DFS needs to keep track of all nodes
                // that were processed and removed from the stack, in order
                // to avoid cycles.
                if (graphSupport) closed.add(nextNode.node.state());
            }
            return nextNode;
        }


        protected StackFrameNode processNextNode(){

            if (stack.isEmpty()) return null;

            // Take last node in the stack but do not remove
            StackFrameNode current = stack.peekLast();
            // Find a successor
            if (current.successors.hasNext()){
                N successor = current.successors.next();
                // push the node (if not explored)
                if (!graphSupport || !closed.contains(successor.state())) {
                    stack.addLast(new StackFrameNode(successor));
                }
                return current;
            } else {
                // Visited?
                if (current.visited){
                    current.processed = true;
                }
               return stack.removeLast();
            }
        }

        public Deque<StackFrameNode> getStack() {
            return stack;
        }

        public void setStack(Deque<StackFrameNode> stack) {
            this.stack = stack;
        }

        public StackFrameNode getNext() {
            return next;
        }

        public void setNext(StackFrameNode next) {
            this.next = next;
        }

        public Set<S> getClosed() {
            return closed;
        }

        public void setClosed(Set<S> closed) {
            this.closed = closed;
        }

        public boolean isGraphSupport() {
            return graphSupport;
        }

        public void setGraphSupport(boolean graphSupport) {
            this.graphSupport = graphSupport;
        }
    }
    @Override
    public java.util.Iterator<N> iterator() {
        return new Iterator();
    }
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/DepthLimitedSearch.java
================================================
package es.usc.citius.hipster.algorithm;

import es.usc.citius.hipster.model.Node;
import es.usc.citius.hipster.model.function.NodeExpander;
import es.usc.citius.hipster.model.impl.UnweightedNode;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Stack;
/**
 * Copyright 2015 Centro de Investigación en Tecnoloxías da Información (CITIUS),
 * University of Santiago de Compostela (USC).
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * <p>
 * In computer science maximumDepth-limited search is an algorithm to explore the vertices of a graph.
 * It is a modification of maximumDepth-first search and is used for example in the iterative deepening
 * maximumDepth-first search algorithm.
 * </p>
 *
 * For more information see <a href="http://en.wikipedia.org/wiki/Depth-limited_search">this article of the Wikipedia</a> about DLS.
 *
 * @author Gabriella Zekany
 */
public class DepthLimitedSearch <A,S,N extends Node<A,S,N>> extends Algorithm<A,S,N> {
    protected N initialNode;
    protected N finalNode;
    protected NodeExpander nodeExpander;
    protected int maximumDepth;
    protected int currentDepth;
    protected ArrayList<S> path;

    public DepthLimitedSearch(N initialNode, N finalNode, NodeExpander nodeExpander, int maximumDepth) {
        this.initialNode = initialNode;
        this.finalNode = finalNode;
        this.nodeExpander = nodeExpander;
        this.maximumDepth = maximumDepth;
        this.currentDepth = 0;
        this.path = new ArrayList<>();
    }

    public int getMaximumDepth() {
        return this.maximumDepth;
    }

    public int getCurrentDepth() {
        return this.currentDepth;
    }

    public ArrayList<S> getPath() {
        return path;
    }

    public void incrementCurrentDepth() {
        this.currentDepth ++;
    }

    public boolean execute() {
        Stack<StackNode> nodeStack = new Stack();
        StackNode tempStackNode = new StackNode(this.initialNode);
        nodeStack.add(tempStackNode);

        while(!nodeStack.isEmpty()) {
            if(this.currentDepth <= this.maximumDepth) {
                StackNode temp = nodeStack.pop();
                if(!path.contains(temp.getNode()) && ((UnweightedNode) temp.getNode()).state().equals(((UnweightedNode)this.finalNode).state())){
                    this.path.add((S) temp.getNode().state());
                    return true;
                }  else {
                    this.path.add((S) temp.getNode().state());
                    for(StackNode child : temp.getChildren()) {
                        if(!this.path.contains(child.getNode().state())) {
                            nodeStack.add(child);
                        }
                    }
                    this.incrementCurrentDepth();
                }
            } else {
                return false;
            }
        }
        return false;
    }

    private class StackNode {
        private N node;
        private java.util.Iterator<N> children;

        public StackNode(N node) {
            this.node = node;
            this.children = nodeExpander.expand(node).iterator();
        }

        public N getNode() {
            return node;
        }

        public void setNode(N node) {
            this.node = node;
        }

        public List<StackNode> getChildren() {
            ArrayList<StackNode> result = new ArrayList<>();
            while(this.children.hasNext()) {
                StackNode temp = new StackNode(this.children.next());
                result.add(temp);
            }
            return result;
        }

        public void setChildren(java.util.Iterator<N> children) {
            this.children = children;
        }
    }

    @Override
    public Iterator<N> iterator() {
        return null;
    }
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/Hipster.java
================================================
/*
 * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package es.usc.citius.hipster.algorithm;

import es.usc.citius.hipster.algorithm.localsearch.AnnealingSearch;
import es.usc.citius.hipster.algorithm.localsearch.HillClimbing;
import es.usc.citius.hipster.algorithm.localsearch.AnnealingSearch.AcceptanceProbability;
import es.usc.citius.hipster.algorithm.localsearch.AnnealingSearch.SuccessorFinder;
import es.usc.citius.hipster.model.CostNode;
import es.usc.citius.hipster.model.HeuristicNode;
import es.usc.citius.hipster.model.Node;
import es.usc.citius.hipster.model.function.NodeExpander;
import es.usc.citius.hipster.model.function.impl.ADStarNodeExpander;
import es.usc.citius.hipster.model.function.impl.ADStarNodeFactory;
import es.usc.citius.hipster.model.impl.ADStarNodeImpl;
import es.usc.citius.hipster.model.problem.SearchComponents;
import es.usc.citius.hipster.model.problem.SearchProblem;

import java.util.Collections;

/**
 * Util class to create algorithms easily. Each method expects a
 * {@link es.usc.citius.hipster.model.problem.SearchProblem} with the components
 * of the algorithm and returns an iterable algorithm that can be used to search
 * a goal or iterate over the state space. A SearchProblem can be easily defined
 * with the {@link es.usc.citius.hipster.model.problem.ProblemBuilder} class.
 *
 * @see es.usc.citius.hipster.model.problem.ProblemBuilder
 *
 * @author Pablo Rodríguez Mier <
 *         <a href="mailto:pablo.rodriguez.mier@usc.es">pablo.rodriguez.mier@usc
 *         .es</a>>
 * @author Adrián González Sieira <
 *         <a href="adrian.gonzalez@usc.es">adrian.gonzalez@usc.es</a>>
 */
public final class Hipster {

	private Hipster() {

	}

	/**
	 * Instantiates a A* algorithm given a problem definition.
	 *
	 * @param components
	 *            search problem definition with the components of the algorithm
	 * @param <A>
	 *            type of the actions
	 * @param <S>
	 *            type of the states
	 * @param <C>
	 *            type of the cost
	 * @param <N>
	 *            type of the nodes
	 * @return instance of {@link es.usc.citius.hipster.algorithm.AStar} for the
	 *         problem definition
	 */
	public static <A, S, C extends Comparable<C>, N extends HeuristicNode<A, S, C, N>> AStar<A, S, C, N> createAStar(
			SearchProblem<A, S, N> components) {
		return new AStar<A, S, C, N>(components.getInitialNode(), components.getExpander());
	}

	/**
	 * Instantiates a Dijkstra algorithm (A* algorithm with no heuristic
	 * function) given a problem definition.
	 *
	 * @param components
	 *            search problem definition with the components of the algorithm
	 * @param <A>
	 *            type of the actions
	 * @param <S>
	 *            type of the states
	 * @param <C>
	 *            type of the cost
	 * @param <N>
	 *            type of the nodes
	 * @return instance of {@link es.usc.citius.hipster.algorithm.AStar} for the
	 *         problem definition, using no heuristic.
	 */
	public static <A, S, C extends Comparable<C>, N extends HeuristicNode<A, S, C, N>> AStar<A, S, C, N> createDijkstra(
			SearchProblem<A, S, N> components) {
		// TODO: There is no difference with AStar. Actually if the NodeExpander
		// uses heuristics, this "Dijkstra" impl works as the AStar. This should
		// be changed!
		return new AStar<A, S, C, N>(components.getInitialNode(), components.getExpander());
	}

	/**
	 * Instantiates a Bellman Ford algorithm for a problem definition.
	 *
	 * @param components
	 *            search problem definition with the components of the algorithm
	 * @param <A>
	 *            type of the actions
	 * @param <S>
	 *            type of the states
	 * @param <C>
	 *            type of the cost
	 * @param <N>
	 *            type of the nodes
	 * @return instance of {@link es.usc.citius.hipster.algorithm.BellmanFord}
	 *         for the problem definition
	 */
	public static <A, S, C extends Comparable<C>, N extends CostNode<A, S, C, N>> BellmanFord<A, S, C, N> createBellmanFord(
			SearchProblem<A, S, N> components) {
		return new BellmanFord<A, S, C, N>(components.getInitialNode(), components.getExpander());
	}

	/**
	 * Instantiates Breadth First Search algorithm for a problem definition.
	 *
	 * @param components
	 *            search problem definition with the components of the algorithm
	 * @param <A>
	 *            type of the actions
	 * @param <S>
	 *            type of the states
	 * @param <N>
	 *            type of the nodes
	 * @return instance of
	 *         {@link es.usc.citius.hipster.algorithm.BreadthFirstSearch} for
	 *         the problem definition
	 */
	public static <A, S, N extends Node<A, S, N>> BreadthFirstSearch<A, S, N> createBreadthFirstSearch(
			SearchProblem<A, S, N> components) {
		return new BreadthFirstSearch<A, S, N>(components.getInitialNode(), components.getExpander());
	}

	/**
	 * Instantiates Depth First Search algorithm for a problem definition.
	 *
	 * @param components
	 *            search problem definition with the components of the algorithm
	 * @param <A>
	 *            type of the actions
	 * @param <S>
	 *            type of the states
	 * @param <N>
	 *            type of the nodes
	 * @return instance of
	 *         {@link es.usc.citius.hipster.algorithm.DepthFirstSearch} for the
	 *         problem definition
	 */
	public static <A, S, N extends Node<A, S, N>> DepthFirstSearch<A, S, N> createDepthFirstSearch(
			SearchProblem<A, S, N> components) {
		return new DepthFirstSearch<A, S, N>(components.getInitialNode(), components.getExpander());
	}

	/**
	 * Instantiates Depth Limited Search algorithm for a problem definition.
	 *
	 * @param components
	 *            search problem definition with the components of the algorithm
	 * @param <A>
	 *            type of the actions
	 * @param <S>
	 *            type of the states
	 * @param <N>
	 *            type of the nodes
	 * @return instance of
	 *         {@link es.usc.citius.hipster.algorithm.DepthFirstSearch} for the
	 *         problem definition
	 */
	public static <A, S, N extends Node<A, S, N>> DepthLimitedSearch<A, S, N> createDepthLimitedSearch(
			SearchProblem<A, S, N> components, int depth) {
		return new DepthLimitedSearch<A, S, N>(components.getInitialNode(), components.getFinalNode(),
				components.getExpander(), depth);
	}

	/**
	 * Instantiates a IDA* algorithm given a problem definition.
	 *
	 * @param components
	 *            search problem definition with the components of the algorithm
	 * @param <A>
	 *            type of the actions
	 * @param <S>
	 *            type of the states
	 * @param <C>
	 *            type of the cost
	 * @param <N>
	 *            type of the nodes
	 * @return instance of {@link es.usc.citius.hipster.algorithm.IDAStar} for
	 *         the problem definition
	 */
	public static <A, S, C extends Comparable<C>, N extends HeuristicNode<A, S, C, N>> IDAStar<A, S, C, N> createIDAStar(
			SearchProblem<A, S, N> components) {
		return new IDAStar<A, S, C, N>(components.getInitialNode(), components.getExpander());
	}

	/**
	 * Instantiates a Hill Climbing algorithm given a problem definition.
	 *
	 * @param components
	 *            search problem definition with the components of the algorithm
	 * @param enforced
	 *            flag to use Enforced Hill Climbing instead of classic Hill
	 *            Climbing algorithm
	 * @param <A>
	 *            type of the actions
	 * @param <S>
	 *            type of the states
	 * @param <C>
	 *            type of the cost
	 * @param <N>
	 *            type of the nodes
	 * @return instance of
	 *         {@link es.usc.citius.hipster.algorithm.localsearch.HillClimbing}
	 *         for the problem definition
	 */
	public static <A, S, C extends Comparable<C>, N extends HeuristicNode<A, S, C, N>> HillClimbing<A, S, C, N> createHillClimbing(
			SearchProblem<A, S, N> components, boolean enforced) {
		return new HillClimbing<A, S, C, N>(components.getInitialNode(), components.getExpander(), enforced);
	}

	/**
	 * Instantiates an AnnealingSearch algorithm given a problem definition.
	 *
	 * @param components
	 *            search problem definition with the components of the algorithm
	 * @param alpha
	 *            coefficient of the geometric cooling schedule
	 * @param <A>
	 *            type of the actions
	 * @param <S>
	 *            type of the states
	 * @param <C>
	 *            type of the cost
	 * @param <N>
	 *            type of the nodes
	 * @return instance of
	 *         {@link es.usc.citius.hipster.algorithm.localsearch.HillClimbing}
	 *         for the problem definition
	 */
	public static <A, S, N extends HeuristicNode<A, S, Double, N>> AnnealingSearch<A, S, N> createAnnealingSearch(
			SearchProblem<A, S, N> components, Double alpha, Double minTemp,
			AcceptanceProbability acceptanceProbability, SuccessorFinder<A, S, N> successorFinder) {
		return new AnnealingSearch<A, S, N>(components.getInitialNode(), components.getExpander(), alpha,
				minTemp, acceptanceProbability, successorFinder);
	}

	/**
	 * Instantiates a Multi-objective Label Setting algorithm given a problem
	 * definition.
	 *
	 * @param components
	 *            search problem definition with the components of the algorithm
	 * @param <A>
	 *            type of the actions
	 * @param <S>
	 *            type of the states
	 * @param <C>
	 *            type of the cost
	 * @param <N>
	 *            type of the nodes
	 * @return instance of
	 *         {@link es.usc.citius.hipster.algorithm.MultiobjectiveLS} for the
	 *         problem definition
	 */
	public static <A, S, C extends Comparable<C>, N extends HeuristicNode<A, S, C, N>> MultiobjectiveLS<A, S, C, N> createMultiobjectiveLS(
			SearchProblem<A, S, N> components) {
		return new MultiobjectiveLS<A, S, C, N>(components.getInitialNode(), components.getExpander());
	}

	/**
	 * Instantiates a Anytime Dynamic A* algorithm given the search components.
	 * Search components can be obtained easily for graph-based problems using
	 * {@link es.usc.citius.hipster.util.graph.GraphSearchProblem}.
	 *
	 * @param components
	 *            search components to be used by the algorithm
	 * @param <A>
	 *            type of the actions
	 * @param <S>
	 *            type of the states
	 * @param <C>
	 *            type of the cost
	 * @return instance of {@link es.usc.citius.hipster.algorithm.ADStarForward}
	 *         for the search components
	 */
	public static <A, S, C extends Comparable<C>> ADStarForward<A, S, C, ADStarNodeImpl<A, S, C>> createADStar(
			SearchComponents<A, S, C> components) {
		// node factory instantiation
		ADStarNodeFactory<A, S, C> factory = new ADStarNodeFactory<A, S, C>(components);
		// node expander instantiation
		ADStarNodeExpander<A, S, C, ADStarNodeImpl<A, S, C>> expander = new ADStarNodeExpander<A, S, C, ADStarNodeImpl<A, S, C>>(
				components, factory, 1.0);
		// instantiate algorithm
		return new ADStarForward(components.getBegin(), Collections.singleton(components.getGoal()), expander);
	}
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/IDAStar.java
================================================
/*
 * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package es.usc.citius.hipster.algorithm;




import es.usc.citius.hipster.model.HeuristicNode;
import es.usc.citius.hipster.model.function.NodeExpander;

/**
 * <p>
 * Implementation of the IDA* algorithm. Similar to Iterative DFS but using heuristics to limit
 * the space search and keeping a very low memory usage.
 * </p>
 *
 * <a href="http://www.sciencedirect.com/science/article/pii/0004370285900840">Original paper</a>:
 * Richard E. Korf <i><b>"Depth-first Iterative-Deepening: An Optimal Admissible Tree Search."</b></i>,
 * Artificial Intelligence, vol. 27, pp. 97-109, 1985.
 *
 * @param <A> action type.
 * @param <S> state type.
 * @param <C> comparable cost used to compare states.
 * @param <N> type of the heuristic search node.
 *
 * @author Pablo Rodríguez Mier <<a href="mailto:pablo.rodriguez.mier@usc.es">pablo.rodriguez.mier@usc.es</a>>
 * @author Jennnnyz
 *
 */
public class IDAStar<A,S,C extends Comparable<C>,N extends HeuristicNode<A,S,C,N>> extends DepthFirstSearch<A,S,N> {

    /**
     * 
     * @param initialNode
     * @param expander 
     */
    public IDAStar(N initialNode, NodeExpander<A,S,N> expander) {
        super(initialNode, expander);
    }

    /**
     * IDA iterator. It expands the next state to be explored. Backtracking
     * is automatically performed so if the state reaches a dead-end the next
     * call to {@code iterator.next()} returns the next state after performing
     * backtracking.
     */

    public class Iterator extends DepthFirstSearch.Iterator {
        protected C fLimit;
        protected C minfLimit;
        protected int reinitialization = 0;

        protected Iterator(){
            // Set initial bound
            super();
            fLimit = initialNode.getEstimation();
            minfLimit = null;
        }

        protected void updateMinFLimit(C currentFLimit){
            if (minfLimit == null){
                minfLimit = currentFLimit;
            } else {
                if (minfLimit.compareTo(currentFLimit)>0){
                    minfLimit = currentFLimit;
                }
            }
        }

        @Override
        protected StackFrameNode nextUnvisited(){
            StackFrameNode nextNode;
            do {
                nextNode = processNextNode();
                // No more neighbors to visit with the current fLimit. Update the new fLimit
                if (nextNode == null){
                    // Reinitialize
                    if (minfLimit != null && minfLimit.compareTo(fLimit)>0){
                        fLimit = minfLimit;
                        reinitialization++;
                        minfLimit = null;
                        super.getStack().addLast(new StackFrameNode(initialNode));
                        nextNode = processNextNode();
                    }
                }
            } while(nextNode != null && (nextNode.processed || nextNode.visited));

            if (nextNode != null){
                nextNode.visited = true;
            }
            return nextNode;
        }

        @Override
        protected StackFrameNode processNextNode(){
            // Get and process the current node. Cases:
            //   1 - empty stack, return null
            //   2 - node exceeds the bound: update minfLimit, pop and skip.
            //   3 - node has neighbors: expand and return current.
            //   4 - node has no neighbors:
            //       4.1 - Node visited before: processed node, pop and skip to the next node.
            //       4.2 - Not visited: we've reached a leaf node.
            //             mark as visited, pop and return.

            // 1- If the stack is empty, change fLimit and reinitialize the search
            if (super.getStack().isEmpty()) return null;

            // Take current node in the stack but do not remove
            StackFrameNode current = (StackFrameNode) super.stack.peekLast();

            // 2 - Check if the current node exceeds the limit bound
            C fCurrent = current.getNode().getScore();
            if (fCurrent.compareTo(fLimit)>0){
                // Current node exceeds the limit bound, update minfLimit, pop and skip.
                updateMinFLimit(fCurrent);
                // Remove from stack
                current.processed = true;
                return (StackFrameNode) super.getStack().removeLast();
            }

            // Find a successor
            if (current.getSuccessors().hasNext()){
                // 3 - Node has at least one neighbor
                N successor = current.getSuccessors().next();
                // push the node
                super.getStack().addLast(new StackFrameNode(successor));
                return current;

            } else {
                // 4 - Visited?
                if (current.visited){
                    current.processed = true;
                }
                return (StackFrameNode) super.getStack().removeLast();
            }
        }

        public C getfLimit() {
            return fLimit;
        }

        public void setfLimit(C fLimit) {
            this.fLimit = fLimit;
        }

        public C getMinfLimit() {
            return minfLimit;
        }

        public void setMinfLimit(C minfLimit) {
            this.minfLimit = minfLimit;
        }

        public int getReinitialization() {
            return reinitialization;
        }

        public void setReinitialization(int reinitialization) {
            this.reinitialization = reinitialization;
        }
    }

    @Override
    public Iterator iterator() {
        return new Iterator();
    }

}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/MultiobjectiveLS.java
================================================
/*
 * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package es.usc.citius.hipster.algorithm;

import es.usc.citius.hipster.model.HeuristicNode;
import es.usc.citius.hipster.model.function.NodeExpander;
import es.usc.citius.hipster.util.Predicate;

import java.util.*;

/**
 * <p>Implementation of the multi-objective label setting algorithm described
 * by Martins and Santos.</p>
 *
 * Original paper:
 * Martins, E. D. Q. V., & Santos, J. L. E. (1999). <b>"The labeling algorithm for the multiobjective shortest path problem"</b>. <i>Departamento de Matematica, Universidade de Coimbra, Portugal, Tech. Rep. TR-99/005</i>.
 *
 * @param <A> action type.
 * @param <S> state type.
 * @param <C> comparable cost used to compare states.
 * @param <N> type of the heuristic search node used.
 *           
 * @author Pablo Rodríguez Mier <<a href="mailto:pablo.rodriguez.mier@usc.es">pablo.rodriguez.mier@usc.es</a>>
 */
public class MultiobjectiveLS<A,S,C extends Comparable<C>,N extends HeuristicNode<A,S,C,N>> extends Algorithm<A,S,N> {

    protected N initialNode;
    protected NodeExpander<A,S,N> nodeExpander;

    public MultiobjectiveLS(N initialNode, NodeExpander<A, S, N> nodeExpander) {
        this.initialNode = initialNode;
        this.nodeExpander = nodeExpander;
    }

    /**
     * MultiobjectiveLS iterator. It expands one state at a time and updates
     * an internal connected (nonDominated) which stores all non-dominated paths.
     * In order to find all non-dominated shortest path, the algorithm must be
     * executed until {@code iterator.hasNext() == false}. Paths can be recovered
     * with {@code iterator.getNonDominated.get(goalState)}
     */
    public class Iterator implements java.util.Iterator<N> {
        protected Queue<N> queue = new LinkedList<N>();
        public Map<S, Collection<N>> nonDominated;
        //auxiliary variable which stores an empty list to avoid nullable values in code
        private final Collection<N> EMPTYLIST = new ArrayList<N>();

        protected Iterator(){
            queue = new PriorityQueue<N>();
            this.nonDominated = new HashMap<S, Collection<N>>();
            this.queue.add(initialNode);
        }

        public boolean hasNext() {
            return !this.queue.isEmpty();
        }

        @Override
        public N next() {
            // 1- Take smallest lexicographical element from queue
            // 2- For all successors:
            // 		- Build the new node, which represents a path from s to t.
            //		- Check all non dominated paths tracked from s to t. If
            //		  this new node is dominated, discard it.
            //		- Add the new node, sorted by a lexicographical comparator
            //		- Check and remove dominated paths
            // Repeat 1.
            // Finally, the node that contains the goal state t, contains
            // the set of all non-dominated paths from s to t.
            N current = queue.poll();
            // Take successors
            for (N candidate : nodeExpander.expand(current)) {
                // Take non-dominated (nd) nodes associated to the current state
                // (i.e., all non-dominated paths from start to currentState
                Collection<N> ndNodes = EMPTYLIST;
                if(!nonDominated.containsKey(candidate.state())){
                    nonDominated.put(candidate.state(), new ArrayList<N>());
                }
                else{
                    ndNodes = nonDominated.get(candidate.state());
                }
                // Check if the node is non-dominated
                if (!isDominated(candidate, ndNodes)) {
                    // Assign the candidate to the queue
                    this.queue.add(candidate);
                    // Add new non dominated path
                    ndNodes.add(candidate);
                    // Re-analyze dominance and remove new dominated paths
                    // Find all paths that can be dominated by the new non-dominated path
                    for (N dominated : dominatedBy(candidate, ndNodes)) {
                        ndNodes.remove(dominated);
                    }
                }
            }
            return current;
        }

        @Override
        public void remove() {
            throw new UnsupportedOperationException();
        }

        protected Collection<N> dominatedBy(N node, Iterable<N> nonDominated) {
            Collection<N> dominated = new HashSet<N>();
            for (N n : nonDominated) {
                if (node.getScore().compareTo(n.getScore())<0) {
                    dominated.add(n);
                }
            }
            return dominated;
        }

        protected boolean isDominated(N node, Iterable<N> nonDominated) {
            // Compare all non-dominated nodes with node
            for (N nd : nonDominated) {
                if (nd.getScore().compareTo(node.getScore())< 0) {
                    return true;
                }
            }
            return false;
        }

        public Queue<N> getQueue() {
            return queue;
        }

        public Map<S, Collection<N>> getNonDominated() {
            return nonDominated;
        }
    }

    @Override
    public SearchResult search(Predicate<N> condition){
        int iteration = 0;
        Iterator it = new Iterator();
        long beginTime = System.currentTimeMillis();
        N currentNode;
        N goalNode = null;
        while(it.hasNext()){
            iteration++;
            currentNode = it.next();
            if (condition.apply(currentNode)) {
                goalNode = currentNode;
            }
        }
        long elapsed = System.currentTimeMillis() - beginTime;
        if (goalNode != null) {
            Collection<N> solutions = it.nonDominated.get(goalNode.state());
            return new SearchResult(solutions, iteration, elapsed);
        }
        return new SearchResult(Collections.<N>emptyList(), iteration, elapsed);
    }

    @Override
    public java.util.Iterator<N> iterator() {
        return new Iterator();
    }
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/NegativeCycleException.java
================================================
package es.usc.citius.hipster.algorithm;


public class NegativeCycleException extends RuntimeException {
    private static final String message = "Existence of a negative cycle detected";

    public NegativeCycleException() {
        super(message);
    }
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/localsearch/AnnealingSearch.java
================================================
package es.usc.citius.hipster.algorithm.localsearch;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import java.util.Random;

import es.usc.citius.hipster.algorithm.Algorithm;
import es.usc.citius.hipster.model.HeuristicNode;
import es.usc.citius.hipster.model.Node;
import es.usc.citius.hipster.model.function.NodeExpander;

/**
 * Implementation of the simulated annealing search that is a probabilistic
 * technique for approximating the global optimum of a given function. It starts
 * the exploration from a random point as a global optimum and selects one of
 * its neighbors with a neighboring function. The neighbor will become the new
 * optimum if its associated cost is lower or if the acceptance probability
 * function returns a probability greater than a random number. The probability
 * function takes as an input the cost of the current selected node, the cost of
 * its randomly selected neighbour and the current temperature. The higher the
 * cost of the neighbour is or the lower the temperature is, the more unlikely
 * it is that the neighbour becomes the new optimum. The process continues until
 * the temperature is below a given threshold. The temperature decreases at each
 * iteration according to a geometric cooling schedule that has two parameters
 * alpha and temperature min. The main idea of this algorithm is to avoid to be
 * "trapped" in a bad local optimum by exploring more deeply the state space by
 * looking at states whose cost is not optimum but that may have interesting
 * neighbours. A user can adjusted the algorithm by tuning the alpha coefficient
 * (default 0.9) or the min temperature (0.00001) or by providing his own
 * implementation of the acceptance probability function (default: exp((old
 * score - new score) / current temperature)) or the neighbouring function
 * (random selection by default). Note: costs are Double in this implementation
 * and have no type parameters.
 * 
 * see <a href="https://en.wikipedia.org/wiki/Simulated_annealing">in
 * Wikipedia</a> and <a href="http://katrinaeg.com/simulated-annealing.html">in
 * annealing search</a> for more details.
 * 
 * @param <A>
 *            class defining the action
 * @param <S>
 *            class defining the state
 * @param <C>
 *            class defining the cost, must implement
 *            {@link java.lang.Comparable}
 * @param <N>
 *            type of the nodes
 * 
 * @author Christophe Moins <
 *         <a href="mailto:christophe.moins@yahoo.fr">christophe.moins@yahoo.fr
 *         </a>>
 */
public class AnnealingSearch<A, S, N extends HeuristicNode<A, S, Double, N>> extends Algorithm<A, S, N> {

	static final private Double DEFAULT_ALPHA = 0.9;
	static final private Double DEFAULT_MIN_TEMP = 0.00001;
	static final private Double START_TEMP = 1.;

	private N initialNode;
	private Double alpha;
	private Double minTemp;
	private AcceptanceProbability acceptanceProbability;
	private SuccessorFinder<A, S, N> successorFinder;
	// expander to find all the successors of a given node.
	private NodeExpander<A, S, N> nodeExpander;

	public AnnealingSearch(N initialNode, NodeExpander<A, S, N> nodeExpander, Double alpha, Double minTemp,
			AcceptanceProbability acceptanceProbability, SuccessorFinder<A, S, N> successorFinder) {
		if (initialNode == null) {
			throw new IllegalArgumentException("Provide a valid initial node");
		}
		this.initialNode = initialNode;
		if (nodeExpander == null) {
			throw new IllegalArgumentException("Provide a valid node expander");
		}
		this.nodeExpander = nodeExpander;
		if (alpha != null) {
			if ((alpha <= 0.) || (alpha >= 1.0)) {
				throw new IllegalArgumentException("alpha must be between 0. and 1.");
			}
			this.alpha = alpha;
		} else {
			this.alpha = DEFAULT_ALPHA;
		}
		if (minTemp != null) {
			if ((minTemp < 0.) || (minTemp > 1.)) {
				throw new IllegalArgumentException("Minimum temperature must be between 0. and 1.");
			}
			this.minTemp = minTemp;
		} else {
			this.minTemp = DEFAULT_MIN_TEMP;
		}
		if (acceptanceProbability != null) {
			this.acceptanceProbability = acceptanceProbability;
		} else {
			this.acceptanceProbability = new AcceptanceProbability() {
				@Override
				public Double compute(Double oldScore, Double newScore, Double temp) {
					return (newScore < oldScore ? 1 : Math.exp((oldScore - newScore) / temp));
				}
			};
		}
		if (successorFinder != null) {
			this.successorFinder = successorFinder;
		} else {
			// default implementation of the successor: picks up a successor
			// randomly
			this.successorFinder = new SuccessorFinder<A, S, N>() {
				@Override
				public N estimate(N node, NodeExpander<A, S, N> nodeExpander) {
					List<N> successors = new ArrayList<>();
					// find a random successor
					for (N successor : nodeExpander.expand(node)) {
						successors.add(successor);
					}
					Random randIndGen = new Random();
					return successors.get(Math.abs(randIndGen.nextInt()) % successors.size());
				}
			};
		}
	}

	@Override
	public ASIterator iterator() {
		// TODO Auto-generated method stub
		return new ASIterator();
	}

	public class ASIterator implements Iterator<N> {

		private Queue<N> queue = new LinkedList<N>();
		private Double bestScore = null;
		private Double curTemp = START_TEMP;

		private ASIterator() {
			bestScore = initialNode.getEstimation();
			queue.add(initialNode);
		}

		@Override
		public boolean hasNext() {
			return !queue.isEmpty();
		}

		@Override
		public N next() {
			N currentNode = this.queue.poll();
			if (curTemp > minTemp) {
				N newNode = null;
				// we add a loop to increase the effect of a change of alpha.
				for (int i = 0; i < 100; i++) {
					N randSuccessor = successorFinder.estimate(currentNode, nodeExpander);
					Double score = randSuccessor.getScore();
					if (acceptanceProbability.compute(bestScore, score, curTemp) > Math.random()) {
						newNode = randSuccessor;
						bestScore = score;
					}
				}
				if (newNode != null) {
					queue.add(newNode);
				} else {
					queue.add(currentNode);
				}
				curTemp *= alpha;
			}
			return currentNode;
		}

		@Override
		public void remove() {
			throw new UnsupportedOperationException();

		}
	}

	/**
	 * Interface to compute the acceptance probability. If the new score is less
	 * than the old score, 1 will be returned so that the node is selected.
	 * Otherwise, we compute a probability that will decrease when the newScore
	 * or the temperature increase.
	 * 
	 */

	public interface AcceptanceProbability {
		Double compute(Double oldScore, Double newScore, Double temp);
	}

	/**
	 * Interface to find the successor of a node.
	 *
	 * @param <N>
	 */
	public interface SuccessorFinder<A, S, N extends Node<A, S, N>> {
		/**
		 * @param Node
		 * @return the successor of a node.
		 */
		N estimate(N node, NodeExpander<A, S, N> nodeExpander);
	}
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/localsearch/HillClimbing.java
================================================
/*
 * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package es.usc.citius.hipster.algorithm.localsearch;




import es.usc.citius.hipster.algorithm.Algorithm;
import es.usc.citius.hipster.model.HeuristicNode;
import es.usc.citius.hipster.model.function.NodeExpander;

import java.util.Iterator;
import java.util.LinkedList;
import java.util.Queue;

/**
 * Implementation of the Hill Climbing algorithm. This is a local search algorithm which starts the exploration
 * of the state space in a random point, and then tries to improve the solution varying a single element of it.
 * This process is repeated iteratively until no further improvements are produced in the solution state.
 *
 * This algorithm performs well finding local optimums, but there is no guarantee to find the best possible solution
 * in the state space. If the state space has a convex cost function then this algoritm is guaranteed to be optimal,
 * but only in that case.
 *
 * Enforced hill climbing uses a BFS search to deal with local optimums, increasing the number of explored states
 * when the neighborhood of a state does not improve the solution.
 *
 * You can find a more detailed description of the algorithm <a href="en.wikipedia.org/wiki/Hill_climbing">in Wikipedia</a>
 * and the book <a href="http://aima.cs.berkeley.edu/">Artificial Intelligence: A Modern Approach</a>
 *
 * @param <A> class defining the action
 * @param <S> class defining the state
 * @param <C> class defining the cost, must implement {@link java.lang.Comparable}
 * @param <N> type of the nodes
 *
 * @author Pablo Rodríguez Mier <<a href="mailto:pablo.rodriguez.mier@usc.es">pablo.rodriguez.mier@usc.es</a>>
 */
public class HillClimbing<A,S,C extends Comparable<C>,N extends HeuristicNode<A,S,C,N>> extends Algorithm<A,S,N> {

    private N initialNode;
    private NodeExpander<A,S,N> nodeExpander;
    private boolean enforced;

    public HillClimbing(N initialNode, NodeExpander<A, S, N> nodeExpander) {
        this(initialNode, nodeExpander, false);
    }

    /**
     * Creates a new hill climbing algorithm with an initial node, a node expander and the boolean flag to
     * use or not enforced hill climbing.
     *
     * @param initialNode initial node of the search
     * @param nodeExpander component which creates new nodes from a current one
     * @param enforcedHillClimbing flag to use enforced hill climbing
     */
    public HillClimbing(N initialNode, NodeExpander<A, S, N> nodeExpander, boolean enforcedHillClimbing) {
        this.initialNode = initialNode;
        this.nodeExpander = nodeExpander;
        this.enforced = enforcedHillClimbing;
    }

    public class EHCIterator implements Iterator<N> {
        private Queue<N> queue = new LinkedList<N>();
        private C bestScore = null;

        private EHCIterator() {
            bestScore = initialNode.getEstimation();
            queue.add(initialNode);
        }

        @Override
        public boolean hasNext() {
            return !queue.isEmpty();
        }

        @Override
        public N next() {
            N current = this.queue.poll();
            N bestNode = null;
            // Generate successors
            for(N successor : nodeExpander.expand(current)){
                // Is this successor better? (has lower score?)
                // Hill climbing, just select the best node
                if (enforced){
                    C score = successor.getScore();
                    if (score.compareTo(bestScore) < 0){
                        bestScore = score;
                        this.queue.clear();
                        this.queue.add(successor);
                        break;
                    }
                } else {
                    if (bestNode == null) bestNode = successor;
                    if (successor.compareTo(bestNode) < 0){
                        bestNode = successor;
                    }
                }

                if (enforced){
                    // Add the successor to the queue to perform BFS search
                    // (enforced hill climbing)
                    this.queue.add(successor);
                }
            }
            // After exploring all successors, only add the best successor
            // to the queue (normal hill climbing)
            if (!enforced) this.queue.add(bestNode);
            // Return the current expanded node
            return current;
        }

        @Override
        public void remove() {
            throw new UnsupportedOperationException();
        }

        /**
         * @return queue of the next nodes to be explored
         */
        public Queue<N> getQueue() {
            return queue;
        }

        /**
         * @param queue new queue of nodes to be used by the algorithm
         */
        public void setQueue(Queue<N> queue) {
            this.queue = queue;
        }

        /**
         * @return best score found by the algorithm at the current iteration
         */
        public C getBestScore() {
            return bestScore;
        }

        /**
         * @param bestScore new best score found
         */
        public void setBestScore(C bestScore) {
            this.bestScore = bestScore;
        }
    }


    @Override
    public EHCIterator iterator() {
        return new EHCIterator();
    }
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/localsearch/package-info.java
================================================
/*
 * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS), University of Santiago de Compostela (USC).
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

/**
 * Implementation of local search algorithms (such as hill climbing).
 */
package es.usc.citius.hipster.algorithm.localsearch;

================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/package-info.java
================================================
/*
 * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS), University of Santiago de Compostela (USC).
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

/**
 * Implementation of the different algorithms included in the library. Use the
 * class {@link es.usc.citius.hipster.algorithm.Hipster} to create algorithms in an easy way.
 */
package es.usc.citius.hipster.algorithm;

================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/DirectedEdge.java
================================================
package es.usc.citius.hipster.graph;

public class DirectedEdge<V,E> implements GraphEdge<V,E> {

    private Pair<V> vertices;
    private E value;

    public DirectedEdge(V vertex1, V vertex2, E value) {
        this.vertices = new Pair<V>(vertex1, vertex2);
        this.value = value;
    }

    @Override
    public V getVertex1() {
        return vertices.getE1();
    }

    @Override
    public V getVertex2() {
        return vertices.getE2();
    }

    @Override
    public E getEdgeValue() {
        return value;
    }

    @Override
    public Type getType() {
        return Type.DIRECTED;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        DirectedEdge<?, ?> that = (DirectedEdge<?, ?>) o;

        if (!vertices.equals(that.vertices)) return false;
        return !(value != null ? !value.equals(that.value) : that.value != null);

    }

    @Override
    public int hashCode() {
        int result = vertices.hashCode();
        result = 31 * result + (value != null ? value.hashCode() : 0);
        return result;
    }
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/GraphBuilder.java
================================================
/*
 * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package es.usc.citius.hipster.graph;

import java.util.LinkedList;
import java.util.List;

/**
 * <p>Graph builder assistant to create a Hipster graph. Usage example:</p>
 * <pre class="prettyprint">
 * {@code
 * HipsterGraph<String,Double> =
 * GraphBuilder.<String,Double>create()
 * .connect("A").to("B").withEdge(4d)
 * .connect("A").to("C").withEdge(2d)
 * .connect("B").to("C").withEdge(5d)
 * .createDirectedGraph();
 * }
 * </pre>
 */
public class GraphBuilder<V, E> {

    private class Connection {
        private V vertex1;
        private V vertex2;
        private E edge;

        private Connection(V vertex1, V vertex2, E edge) {
            this.vertex1 = vertex1;
            this.vertex2 = vertex2;
            this.edge = edge;
        }

        private Connection(V vertex1, V vertex2) {
            this.vertex1 = vertex1;
            this.vertex2 = vertex2;
            this.edge = (E) new Object();
        }

        public V getVertex1() {
            return vertex1;
        }

        public void setVertex1(V vertex1) {
            this.vertex1 = vertex1;
        }

        public V getVertex2() {
            return vertex2;
        }

        public void setVertex2(V vertex2) {
            this.vertex2 = vertex2;
        }

        public E getEdge() {
            return edge;
        }

        public void setEdge(E edge) {
            this.edge = edge;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            Connection that = (Connection) o;

            if (!vertex1.equals(that.vertex1)) return false;
            return vertex2.equals(that.vertex2);

        }
    }

    private List<Connection> connections = new LinkedList<Connection>();

    private GraphBuilder() {}

    public static <V, E> GraphBuilder<V,E> create() {
        return new GraphBuilder<V, E>();
    }

    public Vertex1 connect(V vertex) {
        return new Vertex1(vertex);
    }

    public GraphBuilder<V, E> connect(V vertex1, V vertex2) {
        Vertex1 vertex = new Vertex1(vertex1);
        vertex.to(vertex2);
        return this;
    }

    public HipsterDirectedGraph<V,E> createDirectedGraph() {
        HashBasedHipsterDirectedGraph<V, E> graph = HashBasedHipsterDirectedGraph.create();
        for (Connection c : connections) {
            graph.add(c.vertex1);
            graph.add(c.vertex2);
            graph.connect(c.vertex1, c.vertex2, c.edge);
        }
        return graph;
    }

    public HipsterGraph<V,E> createUndirectedGraph() {
        HashBasedHipsterGraph<V, E> graph = HashBasedHipsterGraph.create();
        for (Connection c : connections) {
            graph.add(c.vertex1);
            graph.add(c.vertex2);
            graph.connect(c.vertex1, c.vertex2, c.edge);
        }
        return graph;
    }

    /**
     * @see GraphBuilder#createDirectedGraph()
     * @return type-erased directed graph
     */
    @Deprecated
    public HipsterDirectedGraph buildDirectedGraph(){
        return createDirectedGraph();
    }

    /**
     * @see GraphBuilder#createUndirectedGraph()
     * @return type-erased undirected graph
     */
    @Deprecated
    public HipsterGraph buildUndirectedGraph(){
        return createUndirectedGraph();
    }


    public final class Vertex1 {
        V vertex1;

        private Vertex1(V vertex) {
            this.vertex1 = vertex;
        }

        public Vertex2 to(V vertex) {
            return new Vertex2(vertex);
        }

        public class Vertex2 {
            V vertex2;

            private Vertex2(V vertex) {
                this.vertex2 = vertex;
                connections.add(new Connection(vertex1, vertex2));
            }

            public GraphBuilder<V, E> withEdge(E edge) {
                Connection connection = new Connection(vertex1, vertex2);
                int connectionIndex = connections.indexOf(connection);
                if(connectionIndex != -1 ) {
                    connections.get(connectionIndex).setEdge(edge);
                } else {
                    connection.setEdge(edge);
                    connections.add(connection);
                }
                return GraphBuilder.this;
            }
        }
    }

}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/GraphEdge.java
================================================
/*
 * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package es.usc.citius.hipster.graph;


/**
 * Hipster graph edge implementation to represent edges (or arcs) of a directed or
 * undirected graph.
 *
 * @param <V> vertex type.
 * @param <E> edge type.
 */
public interface GraphEdge<V,E> {
    enum Type { DIRECTED, UNDIRECTED }

    V getVertex1();
    V getVertex2();
    E getEdgeValue();
    Type getType();

//    @Override
//    public String toString() {
//        return getVertex1() + " ---(" + edgeValue + ")---" + (isDirected() ? "> " : " ") + getVertex2();
//    }
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/GraphSearchProblem.java
================================================
/*
 * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package es.usc.citius.hipster.graph;


import es.usc.citius.hipster.model.Transition;
import es.usc.citius.hipster.model.function.CostFunction;
import es.usc.citius.hipster.model.function.HeuristicFunction;
import es.usc.citius.hipster.model.function.TransitionFunction;
import es.usc.citius.hipster.model.function.impl.BinaryOperation;
import es.usc.citius.hipster.model.function.impl.ScalarOperation;
import es.usc.citius.hipster.model.impl.UnweightedNode;
import es.usc.citius.hipster.model.impl.WeightedNode;
import es.usc.citius.hipster.model.problem.ProblemBuilder;
import es.usc.citius.hipster.model.problem.SearchComponents;
import es.usc.citius.hipster.model.problem.SearchProblem;
import es.usc.citius.hipster.util.Function;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;

/**
 * Builder to generate a {@link es.usc.citius.hipster.model.problem.SearchProblem} but using
 * a HipsterGraph.
 * 
 * @author Pablo Rodríguez Mier
 */
public final class GraphSearchProblem {

    public static <V> FromVertex<V> startingFrom(V vertex) {
        return new FromVertex<V>(vertex);
    }

    public static class FromVertex<V> {
        private V fromVertex;
        private V toVertex;

        public FromVertex<V> goalAt(V vertex) {
            this.toVertex = vertex;
            return this;
        }

        private FromVertex(V fromVertex) {
            this.fromVertex = fromVertex;
        }

        public <E> CostType<E> in(final HipsterGraph<V, E> graph) {
            TransitionFunction<E, V> tf;
            if (graph instanceof HipsterDirectedGraph) {
                final HipsterDirectedGraph<V, E> dg = (HipsterDirectedGraph<V, E>) graph;
                tf = new TransitionFunction<E, V>() {
                    @Override
                    public Iterable<Transition<E, V>> transitionsFrom(final V state) {
                        ArrayList<Transition<E, V>> transitions = new ArrayList<Transition<E, V>>();
                        for(GraphEdge<V, E> edge : dg.outgoingEdgesOf(state)){
                            transitions.add(Transition.create(state, edge.getEdgeValue(), edge.getVertex2()));
                        }
                        return transitions;
                    }
                };
            } else {
                tf = new TransitionFunction<E, V>() {
                    @Override
                    public Iterable<Transition<E, V>> transitionsFrom(final V state) {
                        ArrayList<Transition<E, V>> transitions = new ArrayList<Transition<E, V>>();
                        for(GraphEdge<V, E> edge : graph.edgesOf(state)){
                            V oppositeVertex = edge.getVertex1().equals(state) ? edge.getVertex2() : edge.getVertex1();
                            transitions.add(Transition.create(state, edge.getEdgeValue(), oppositeVertex));
                        }
                        return transitions;
                    }
                };
            }
            return new CostType<E>(tf);
        }

        public <E> CostType<E> inGraphWithLexicographicalOrder(final HipsterGraph<V, E> graph) {

            class ComparatorTransitions implements Comparator<Transition<E, V>>{

                @Override
                public int compare(Transition<E, V> o1, Transition<E, V> o2) {
                    return o1.getState().toString().compareTo(o2.getState().toString());
                }
            }

            TransitionFunction<E, V> tf;
            if (graph instanceof HipsterDirectedGraph) {
                final HipsterDirectedGraph<V, E> dg = (HipsterDirectedGraph<V, E>) graph;
                tf = new TransitionFunction<E, V>() {
                    @Override
                    public Iterable<Transition<E, V>> transitionsFrom(final V state) {
                        ArrayList<Transition<E, V>> transitions = new ArrayList<Transition<E, V>>();
                        for(GraphEdge<V, E> edge : dg.outgoingEdgesOf(state)){
                            transitions.add(Transition.create(state, edge.getEdgeValue(), edge.getVertex2()));
                        }
                        Collections.sort(transitions, new ComparatorTransitions());
                        return transitions;
                    }
                };
            } else {
                tf = new TransitionFunction<E, V>() {
                    @Override
                    public Iterable<Transition<E, V>> transitionsFrom(final V state) {
                        ArrayList<Transition<E, V>> transitions = new ArrayList<Transition<E, V>>();
                        for(GraphEdge<V, E> edge : graph.edgesOf(state)){
                            V oppositeVertex = edge.getVertex1().equals(state) ? edge.getVertex2() : edge.getVertex1();
                            transitions.add(Transition.create(state, edge.getEdgeValue(), oppositeVertex));
                        }
                        Collections.sort(transitions, new ComparatorTransitions());
                        return transitions;
                    }
                };
            }
            return new CostType<E>(tf);
        }

        public class CostType<E> {
            private TransitionFunction<E, V> tf;

            private CostType(TransitionFunction<E, V> tf) {
                this.tf = tf;
            }

            public HeuristicType<Double> takeCostsFromEdges() {
                // Try to automatically obtain weights from edges
                CostFunction<E, V, Double> cf = new CostFunction<E, V, Double>() {
                    @Override
                    public Double evaluate(Transition<E, V> transition) {
                        E action = transition.getAction();

                        if (action instanceof Number) {
                            // Try to cast to number automatically
                            return ((Number) action).doubleValue();
                        } else if (action instanceof String){
                            // Try to parse to a number
                            try {
                                return Double.parseDouble((String) action);
                            } catch (NumberFormatException e){
                                throw new IllegalArgumentException("Exception ocurred when trying" +
                                        "to cast " + action + " to a number. Use the method " +
                                        "extractCostsFromEdges to define a custom evaluation strategy.", e);
                            }
                        } else {
                            // TODO: Throw exception instead?
                            // Assume uniform costs.
                            return 1d;
                            /*
                            throw new ClassCastException("The defined graph uses edges of type " +
                                    action.getClass() + " instead of Number. For custom edge costs" +
                                    " please use withGenericCosts method.");*/
                        }

                    }
                };
                return new HeuristicType<Double>(cf, BinaryOperation.doubleAdditionOp()).useScaleAlgebra(ScalarOperation.doubleMultiplicationOp());
            }

            public HeuristicType<Double> extractCostFromEdges(final Function<E, Double> extractor) {
                CostFunction<E, V, Double> cf = new CostFunction<E, V, Double>() {
                    @Override
                    public Double evaluate(Transition<E, V> transition) {
                        return extractor.apply(transition.getAction());
                    }
                };
                return new HeuristicType<Double>(cf, BinaryOperation.doubleAdditionOp()).useScaleAlgebra(ScalarOperation.doubleMultiplicationOp());
            }

            public <C extends Comparable<C>> HeuristicType<C> useGenericCosts(BinaryOperation<C> costAlgebra) {
                CostFunction<E, V, C> cf = new CostFunction<E, V, C>() {
                    @Override
                    public C evaluate(Transition<E, V> transition) {
                        return (C) transition.getAction();
                    }
                };
                return new HeuristicType<C>(cf, costAlgebra);
            }

            public SearchProblem<E, V, UnweightedNode<E, V>> build() {
                return ProblemBuilder.create()
                        .initialState(fromVertex, toVertex)
                        .defineProblemWithExplicitActions()
                        .useTransitionFunction(tf)
                        .build();
            }

            public class HeuristicType<C extends Comparable<C>> {
                private CostFunction<E, V, C> cf;
                private BinaryOperation<C> costAlgebra;
                private ScalarOperation<C> scaleAlgebra;

                private HeuristicType(CostFunction<E, V, C> cf, BinaryOperation<C> costAlgebra) {
                    this.cf = cf;
                    this.costAlgebra = costAlgebra;
                }

                public HeuristicType<C> useScaleAlgebra(ScalarOperation<C> scaleAlgebra){
                    this.scaleAlgebra = scaleAlgebra;
                    return this;
                }

                public Final useHeuristicFunction(HeuristicFunction<V, C> hf) {
                    return new Final(hf);
                }

                public SearchProblem<E, V, WeightedNode<E, V, C>> build() {
                    return ProblemBuilder.create()
                            .initialState(fromVertex)
                            .defineProblemWithExplicitActions()
                            .useTransitionFunction(tf)
                            .useGenericCostFunction(cf, costAlgebra)
                            .build();
                }

                public class Final {
                    private HeuristicFunction<V, C> hf;

                    private Final(HeuristicFunction<V, C> hf) {
                        this.hf = hf;
                    }

                    public SearchComponents<E, V, C> components(){
                        return new SearchComponents<E, V, C>(fromVertex, toVertex, cf, hf, tf, tf, costAlgebra, scaleAlgebra);
                    }

                    public SearchProblem<E, V, WeightedNode<E, V, C>> build() {
                        return ProblemBuilder.create()
                                .initialState(fromVertex)
                                .defineProblemWithExplicitActions()
                                .useTransitionFunction(tf)
                                .useGenericCostFunction(cf, costAlgebra)
                                .useHeuristicFunction(hf)
                                .build();
                    }
                }
            }
        }

    }
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/HashBasedHipsterDirectedGraph.java
================================================
/*
 * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package es.usc.citius.hipster.graph;

import es.usc.citius.hipster.util.Function;
import es.usc.citius.hipster.util.F;

import java.util.*;

/**
 * Implementation of a HipsterDirectedGraph using a Guava Hash Table.
 *
 * @author Pablo Rodríguez Mier <<a href="mailto:pablo.rodriguez.mier@usc.es">pablo.rodriguez.mier@usc.es</a>>
 */
public class HashBasedHipsterDirectedGraph<V, E> extends HashBasedHipsterGraph<V, E> implements HipsterMutableGraph<V, E>, HipsterDirectedGraph<V, E> {


    @Override
    public GraphEdge<V, E> buildEdge(V v1, V v2, E value) {
        return new DirectedEdge<V, E>(v1, v2, value);
    }

    @Override
    public Iterable<GraphEdge<V, E>> outgoingEdgesOf(final V vertex) {
        return F.filter(edgesOf(vertex), new Function<GraphEdge<V, E>, Boolean>() {
            @Override
            public Boolean apply(GraphEdge<V, E> edge) {
                return edge.getVertex1().equals(vertex);
            }
        });
    }

    @Override
    public Iterable<GraphEdge<V, E>> incomingEdgesOf(final V vertex) {
        return F.filter(edgesOf(vertex), new Function<GraphEdge<V, E>, Boolean>() {
            @Override
            public Boolean apply(GraphEdge<V, E> edge) {
                return edge.getVertex2().equals(vertex);
            }
        });
    }

    @Override
    public Iterable<GraphEdge<V, E>> edges() {
        // TODO: [java-8-migration] use stream filter
        return F.map(
                F.filter(HashBasedHipsterDirectedGraph.super.vedges(),
                        new Function<Map.Entry<V, GraphEdge<V, E>>, Boolean>() {
                            @Override
                            public Boolean apply(Map.Entry<V, GraphEdge<V, E>> input) {
                                return input.getKey().equals(input.getValue().getVertex1());
                            }
                        }),
                new Function<Map.Entry<V, GraphEdge<V, E>>, GraphEdge<V, E>>() {
                    @Override
                    public GraphEdge<V, E> apply(Map.Entry<V, GraphEdge<V, E>> input) {
                        return input.getValue();
                    }
                });
    }

    public static <V, E> HashBasedHipsterDirectedGraph<V, E> create() {
        return new HashBasedHipsterDirectedGraph<V, E>();
    }
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/HashBasedHipsterGraph.java
================================================
/*
 * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package es.usc.citius.hipster.graph;


import es.usc.citius.hipster.util.F;
import es.usc.citius.hipster.util.Function;

import java.util.*;

/**
 * Lightweight implementation of an in-memory, mutable graph backed to a {@link HashMap} where
 * keys are vertices and edges are {@link GraphEdge}s
 */
public class HashBasedHipsterGraph<V,E> implements HipsterMutableGraph<V,E> {
    protected HashMap<V, Set<GraphEdge<V, E>>> connected;

    public HashBasedHipsterGraph(){
        this.connected = new HashMap<V, Set<GraphEdge<V, E>>>();
    }

    @Override
    public boolean add(V v){
        //add a new entry to the hash map if it does not exist
        if(!connected.containsKey(v)){
            connected.put(v, new LinkedHashSet<GraphEdge<V, E>>());
            return true;
        }
        return false;
    }

    @Override
    public Set<V> add(V... vertices) {
        Set<V> added = new HashSet<V>();
        for(V v : vertices){
            if (add(v)) added.add(v);
        }
        return added;
    }

    @Override
    public boolean remove(V v){
        // Remove all edges related to v
        Set<GraphEdge<V, E>> edges = this.connected.get(v);
        if (edges == null) return false;

        for(Iterator<GraphEdge<V,E>> it = edges.iterator(); it.hasNext(); ){
            // Remove the edge in the list of the selected vertex
            GraphEdge<V,E> edge = it.next();
            it.remove();

            V v2 = edge.getVertex1().equals(v) ? edge.getVertex2() : edge.getVertex1();
            for(Iterator<GraphEdge<V,E>> it2 = this.connected.get(v2).iterator(); it2.hasNext();){
                GraphEdge<V,E> edge2 = it2.next();
                if (edge2.getVertex1().equals(v) || edge2.getVertex2().equals(v)){
                    it2.remove();
                }
            }
        }
        this.connected.remove(v);
        return true;
    }

    @Override
    public Set<V> remove(V... vertices) {
        Set<V> removed = new HashSet<V>();
        for(V v : vertices){
            if (remove(v)) removed.add(v);
        }
        return removed;
    }

    @Override
    public GraphEdge<V,E> connect(V v1, V v2, E value){
        // Check non-null arguments
        if(v1 == null || v2 == null) throw new IllegalArgumentException("Invalid vertices. A vertex cannot be null");
        // Ensure that the vertices are in the graph
        if (!connected.containsKey(v1)) throw new IllegalArgumentException(v1 + " is not a vertex of the graph");
        if (!connected.containsKey(v2)) throw new IllegalArgumentException(v2 + " is not a vertex of the graph");
        GraphEdge<V,E> edge = buildEdge(v1, v2, value);
        // Associate the vertices with their edge
        connected.get(v1).add(edge);
        connected.get(v2).add(edge);
        return edge;
    }

    public GraphEdge<V,E> buildEdge(V v1, V v2, E value){
        return new UndirectedEdge<V, E>(v1, v2, value);
    }

    private Map.Entry<V, GraphEdge<V,E>> createEntry(final V vertex, final GraphEdge<V,E> edge){
        return new Map.Entry<V, GraphEdge<V, E>>() {
            @Override
            public V getKey() {
                return vertex;
            }

            @Override
            public GraphEdge<V, E> getValue() {
                return edge;
            }

            @Override
            public GraphEdge<V, E> setValue(GraphEdge<V, E> value) {
                throw new UnsupportedOperationException();
            }
        };
    }

    protected Iterable<Map.Entry<V, GraphEdge<V,E>>> vedges(){
        // TODO: [java-8-migration]
        return F.flatMap(connected.entrySet(), new Function<Map.Entry<V, Set<GraphEdge<V, E>>>, Iterable<Map.Entry<V, GraphEdge<V, E>>>>() {
            @Override
            public Iterable<Map.Entry<V, GraphEdge<V, E>>> apply(final Map.Entry<V, Set<GraphEdge<V, E>>> entry) {
                return F.map(entry.getValue(), new Function<GraphEdge<V, E>, Map.Entry<V, GraphEdge<V, E>>>() {
                    @Override
                    public Map.Entry<V, GraphEdge<V, E>> apply(GraphEdge<V, E> input) {
                        return createEntry(entry.getKey(), input);
                    }
                });
            }
        });
    }
    /**
     * Returns a list of the edges in the graph.
     * @return edges of the graph.
     */
    @Override
    public Iterable<GraphEdge<V, E>> edges() {
        return F.map(vedges(), new Function<Map.Entry<V, GraphEdge<V, E>>, GraphEdge<V, E>>() {
            @Override
            public GraphEdge<V, E> apply(Map.Entry<V, GraphEdge<V, E>> entry) {
                return entry.getValue();
            }
        });
    }

    /**
     * Returns the vertices of the graph. Any changes in the
     * returned iterator affect the underlying graph structure.
     * @return iterator with the vertices of the graph
     */
    @Override
    public Iterable<V> vertices() {
        return connected.keySet();
    }

    @Override
    public Iterable<GraphEdge<V, E>> edgesOf(V vertex) {
        Set<GraphEdge<V, E>> set = connected.get(vertex);
        if (set == null) set = Collections.emptySet();
        return set;
    }

    /**
     * Returns the internal HashMap representation of the graph
     * @return HashMap where keys are vertices and values a set with the connected edges
     */
    public HashMap<V, Set<GraphEdge<V, E>>> getConnected() {
        return connected;
    }

    public void setConnected(HashMap<V, Set<GraphEdge<V, E>>> connected) {
        this.connected = connected;
    }

    public static <V,E> HashBasedHipsterGraph<V, E> create() {
        return new HashBasedHipsterGraph<V, E>();
    }
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/HipsterDirectedGraph.java
================================================
/*
 * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package es.usc.citius.hipster.graph;

/**
 * A simple representation of a directed graph with two methods for
 * retrieving the outgoing edges and the incoming edges for a vertex.
 * @param <V> vertex type.
 * @param <E> edge type.
 */
public interface HipsterDirectedGraph<V,E> extends HipsterGraph<V,E> {
    Iterable<GraphEdge<V,E>> outgoingEdgesOf(V vertex);
    Iterable<GraphEdge<V,E>> incomingEdgesOf(V vertex);
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/HipsterGraph.java
================================================
/*
 * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package es.usc.citius.hipster.graph;

/**
 * Basic definition of the read-only methods for a graph in terms of edges and vertices.
 * @param <V> vertex type.
 * @param <E> edge type.
 */
public interface HipsterGraph<V,E> {
    /**
     * Returns an {@link Iterable} of the edges in the graph.
     * @return an iterable of {@link GraphEdge} in the graph
     */
    Iterable<GraphEdge<V,E>> edges();

    /**
     * Returns an iterable of the vertices in the graph.
     * @return iterable of vertices
     */
    Iterable<V> vertices();

    /**
     * Return all the edges that are connected with the given vertex.
     * @param vertex vertex to be queried
     * @return an iterable of {@link GraphEdge}s connected to the vertex
     */
    Iterable<GraphEdge<V,E>> edgesOf(V vertex);

}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/HipsterMutableGraph.java
================================================
package es.usc.citius.hipster.graph;


import java.util.Set;

/**
 * Interface that defines the basic mutable methods to manipulate graphs
 * @param <V> vertex type.
 * @param <E> edge type.
 */
public interface HipsterMutableGraph<V,E> extends HipsterGraph<V,E> {
    /**
     * Adds a new vertex to the graph.
     * @param vertex vertex to be added
     * @return true if the vertex was added to the graph, false if the vertex is already present
     */
    boolean add(V vertex);

    /**
     * Adds multiple vertices to the graph.
     * @param vertices vertices to be added
     * @return set with the vertices added
     */
    Set<V> add(V... vertices);

    /**
     * Removes the vertex from the graph
     * @param vertex vertex to be removed
     * @return true if the vertex was removed, false if the vertex is not present
     */
    boolean remove(V vertex);

    /**
     * Removes multiple vertices from the graph
     * @param vertices vertices to be removed
     * @return set of vertices removed from the graph
     */
    Set<V> remove(V... vertices);

    /**
     * Connects to vertices of the graph through an edge
     * @param vertex1 source vertex
     * @param vertex2 target (destination) vertex
     * @param edgeValue value of the edge connecting vertex1 and vertex2
     * @return a new {@link GraphEdge} connecting both vertices
     */
    GraphEdge<V,E> connect(V vertex1, V vertex2, E edgeValue);
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/Pair.java
================================================
package es.usc.citius.hipster.graph;


public class Pair<E> {
    private E e1, e2;

    public Pair(E e1, E e2) {
        if (e1 == null) throw new IllegalArgumentException("First element cannot be null");
        this.e1 = e1;
        if (e2 == null) throw new IllegalArgumentException("Second element cannot be null");
        this.e2 = e2;
    }

    public E _1() {
        return e1;
    }

    public E _2() {
        return e2;
    }

    public E getE1() {
        return e1;
    }

    public void setE1(E e1) {
        this.e1 = e1;
    }

    public E getE2() {
        return e2;
    }

    public void setE2(E e2) {
        this.e2 = e2;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Pair<?> pair = (Pair<?>) o;

        if (!e1.equals(pair.e1)) return false;
        return e2.equals(pair.e2);

    }

    @Override
    public int hashCode() {
        int result = e1.hashCode();
        result = 31 * result + e2.hashCode();
        return result;
    }

    @Override
    public String toString() {
        return "(" + e1 + ", " + e2 + ")";
    }
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/UndirectedEdge.java
================================================
package es.usc.citius.hipster.graph;


public class UndirectedEdge<V,E> implements GraphEdge<V,E> {

    private UnorderedPair<V> vertices;
    private E value;

    public UndirectedEdge(V vertex1, V vertex2, E value) {
        this.vertices = new UnorderedPair<V>(vertex1, vertex2);
        this.value = value;
    }

    @Override
    public V getVertex1() {
        return vertices.getE1();
    }

    @Override
    public V getVertex2() {
        return vertices.getE2();
    }

    @Override
    public E getEdgeValue() {
        return value;
    }

    @Override
    public Type getType() {
        return Type.UNDIRECTED;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UndirectedEdge<?, ?> that = (UndirectedEdge<?, ?>) o;

        if (!vertices.equals(that.vertices)) return false;
        return !(value != null ? !value.equals(that.value) : that.value != null);

    }

    @Override
    public int hashCode() {
        int result = vertices.hashCode();
        result = 31 * result + (value != null ? value.hashCode() : 0);
        return result;
    }
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/UniqueEdge.java
================================================
/*
 * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package es.usc.citius.hipster.graph;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * Dumb class that can be used to generate unique edges for a graph with a value.
 * Do not use this for production code!
 * @param <V> edge value type
 *
 * @author Pablo Rodríguez Mier
 */
public class UniqueEdge<V> {
    private V value;
    private final String edgeId;
    private static final AtomicInteger idGenerator = new AtomicInteger(0);

    public UniqueEdge(V value) {
        this.value = value;
        this.edgeId = String.valueOf(idGenerator.getAndIncrement());
    }

    public V getValue() {
        return value;
    }

    public void setValue(V value) {
        this.value = value;
    }

    public String getEdgeId() {
        return edgeId;
    }

    public static <V> UniqueEdge<V> create(V value){
        return new UniqueEdge<V>(value);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UniqueEdge that = (UniqueEdge) o;

        if (!edgeId.equals(that.edgeId)) return false;
        if (value != null ? !value.equals(that.value) : that.value != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = value != null ? value.hashCode() : 0;
        result = 31 * result + edgeId.hashCode();
        return result;
    }

    @Override
    public String toString() {
        return "UniqueEdge{" +
                "value=" + value +
                ", edgeId='" + edgeId + '\'' +
                '}';
    }
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/UnorderedPair.java
================================================
package es.usc.citius.hipster.graph;

public class UnorderedPair<E> {
    private E e1, e2;

    public UnorderedPair(E e1, E e2) {
        if (e1 == null) throw new IllegalArgumentException("First element cannot be null");
        this.e1 = e1;
        if (e2 == null) throw new IllegalArgumentException("Second element cannot be null");
        this.e2 = e2;
    }

    public boolean contains(Object vertex){
        return e1.equals(vertex) || e2.equals(vertex);
    }

    public E getE1() {
        return e1;
    }

    public void setE1(E e1) {
        this.e1 = e1;
    }

    public E getE2() {
        return e2;
    }

    public void setE2(E e2) {
        this.e2 = e2;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UnorderedPair<?> that = (UnorderedPair<?>) o;
        return that.contains(e1) && that.contains(e2);
    }

    @Override
    public int hashCode() {
        return e1.hashCode() + e2.hashCode();
    }

    @Override
    public String toString() {
        return "(" + e1 + ", " + e2 + ")";
    }
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/package-info.java
================================================
/*
 * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS), University of Santiago de Compostela (USC).
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

/**
 * Lightweight graph interfaces and in-memory graph implementations.
 */
package es.usc.citius.hipster.graph;

================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/ADStarNode.java
================================================
package es.usc.citius.hipster.model;

import es.usc.citius.hipster.model.function.ScalarFunction;
import es.usc.citius.hipster.model.function.impl.BinaryOperation;

/**
 * Implementation of {@link es.usc.citius.hipster.model.Node} to be used with the AD* algorithm, implemented in
 * {@link es.usc.citius.hipster.algorithm.ADStarForward}. AD* nodes are formed by two cost elements, G and V,
 * and a {@link es.usc.citius.hipster.model.ADStarNode.Key} which is used to order the nodes by priority
 * in the queues of the algorithm. This implementation extends {@link es.usc.citius.hipster.model.HeuristicNode}.
 *
 * @param <A> type of the actions
 * @param <S> type of the state
 * @param <C> type of the cost (must extend {@link java.lang.Comparable})
 * @param <N> node type
 *
 * @author Adrián González Sieira <<a href="adrian.gonzalez@usc.es">adrian.gonzalez@usc.es</a>>
 */
public interface ADStarNode<A, S, C extends Comparable<C>, N extends ADStarNode<A,S,C,N>> extends HeuristicNode<A, S, C, N> {

    /**
     * @return G-cost of the node
     */
    public C getG();

    /**
     * @return V-cost (also RHS) of the node
     */
    public C getV();

    /**
     * @return determines if the nodes must be updated by a {@link es.usc.citius.hipster.model.function.impl.ADStarNodeUpdater}.
     */
    public boolean isDoUpdate();

    /**
     * @return determines if the node is in a consistent or inconsistent state based on the values of G and V
     */
    public boolean isConsistent();

    /**
     * @param g new value of G
     */
    public void setG(C g);

    /**
     * @param v new value of V
     */
    public void setV(C v);

    /**
     * @param update set a new value for the calculate flag of this node
     */
    public void setDoUpdate(boolean update);

    /**
     * @param key new key to compare the priority of the nodes
     */
    public void setKey(Key<C> key);

    /**
     * @return retrieves the current key of the node
     */
    public Key<C> getKey();

    /**
     * @param parent new parent of the node
     */
    public void setPreviousNode(N parent);

    /**
     * @param state state of this node
     */
    public void setState(S state);

    /**
     * @param action action between the parent and this node
     */
    public void setAction(A action);


    /**
     * Inner class defining the key of the node, which depends on the values of G and V. The
     * key of the node is the comparison criterion for ADStarForward to order the open queue.
     */
    public static class Key<C extends Comparable<C>> implements Comparable<Key<C>> {

        private C first;
        private C second;

        /**
         * Constructor to calculate a the key to order the nodes in the Open
         * queue.
         *
         * @param g g value of the node
         * @param v v value of the node
         * @param h value of the heuristic
         * @param e inflation value
         */
        public Key(C g, C v, C h, double e, BinaryOperation<C> add, ScalarFunction<C> scale) {
            calculate(g, v, h, e, add, scale);
        }

        /**
         * Updates the value of the key. This is done for efficiency, to avoid
         * creating new instances.
         */
        public void update(C g, C v, C h, double e, BinaryOperation<C> add, ScalarFunction<C> scale){
            calculate(g, v, h, e, add, scale);
        }

        /**
         * Updates the value of the key
         */
        private void calculate(C g, C v, C h, double e, BinaryOperation<C> add, ScalarFunction<C> scale){
            if (v.compareTo(g) >= 0) {
                this.first = add.apply(g, scale.scale(h, e)); //g + h*e
                this.second = g;
            } else {
                this.first = add.apply(v, h); //v + h
                this.second = v;
            }
        }

        /**
         * Instantiates a new Key given its first and second value instead of
         * calculating them.
         *
         * @param first first cost value
         * @param second second cost value
         */
        public Key(C first, C second){
            this.first = first;
            this.second = second;
        }

        /**
         * Compares by the first value and, if equal, by the second one.
         *
         * @param o other Key object
         * @return comparison result
         */
        public int compareTo(Key<C> o) {
            int firstCompare = this.first.compareTo(o.first);
            if (firstCompare == 0) {
                return this.second.compareTo(o.second);
            } else {
                return firstCompare;
            }
        }

        /**
         * @return first value of the key
         */
        public C getFirst() {
            return first;
        }

        /**
         * @return second value of the key
         */
        public C getSecond() {
            return second;
        }
    }

}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/AbstractNode.java
================================================
/*
 * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package es.usc.citius.hipster.model;


import java.util.LinkedList;
import java.util.List;

/**
 * Basic implementation of the interface {@link es.usc.citius.hipster.model.Node}. All implementations of
 * the interface may extend this class to reuse the implemented {@link #path()} method and
 * the getters.
 *
 * @param <A> type of the actions
 * @param <S> type of the state
 * @param <N> type of the node
 *
 * @author Pablo Rodríguez Mier <<a href="mailto:pablo.rodriguez.mier@usc.es">pablo.rodriguez.mier@usc.es</a>>
 * @author Adrián González Sieira <<a href="adrian.gonzalez@usc.es">adrian.gonzalez@usc.es</a>>
 */
public class AbstractNode<A,S,N extends AbstractNode<A,S,N>> implements Node<A,S,N> {
    protected N previousNode;
    protected S state;
    protected A action;
    protected int pathSize;

    /**
     * Generic constructor of nodes.
     *
     * @param previousNode parent node
     * @param state current state
     * @param action action between the previous node and the current state
     */
    public AbstractNode(N previousNode, S state, A action) {
        this.previousNode = previousNode;
        this.state = state;
        this.action = action;
        this.pathSize =  (previousNode != null) ? previousNode.pathSize + 1 : 1;
    }

    @Override
    public List<N> path() {
        LinkedList<N> path = new LinkedList<N>();
        N currentNode = (N) this;
        while(currentNode != null){
            path.addFirst(currentNode);
            currentNode = currentNode.previousNode;
        }
        return path;
    }

    @Override
    public int pathSize() {
        return pathSize;
    }

    @Override
    public N previousNode() {
        return this.previousNode;
    }

    @Override
    public S state() {
        return state;
    }

    @Override
    public A action() {
        return action;
    }

    @Override
    public String toString() {
        return "Node{" +
                "action=" + action +
                ", state=" + this.state() +
                '}';
    }
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/CostNode.java
================================================
/*
 * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package es.usc.citius.hipster.model;

/**
 * Defines a node which stores an attribute for the cost, extending
 * the interface of a basic node {@link es.usc.citius.hipster.model.Node}. The cost has
 * a generic definition but must be comparable. This type of node is used by algorithms
 * which store information about the cost from the cost but do not use a heuristic function
 * to estimate the cost to the goal.
 *
 * @param <A> type of the actions
 * @param <S> type of the state
 * @param <C> type of the cost (must extend {@link java.lang.Comparable})
 * @param <N> node type
 *
 * @author Pablo Rodríguez Mier <<a href="mailto:pablo.rodriguez.mier@usc.es">pablo.rodriguez.mier@usc.es</a>>
 * @author Adrián González Sieira <<a href="adrian.gonzalez@usc.es">adrian.gonzalez@usc.es</a>>
 */
public interface CostNode<A,S,C extends Comparable<C>,N extends CostNode<A,S,C,N>> extends Node<A,S,N>, Comparable<N> {

    /**
     * @return the cost of this node
     */
    C getCost();
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/HeuristicNode.java
================================================
/*
 * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package es.usc.citius.hipster.model;

/**
 * Type of node which stores an estimated (heuristic) cost to the goal, extending
 * the interface of a cost node {@link es.usc.citius.hipster.model.CostNode}. Cost and
 * heuristic are of the same type and must be comparable. This type of node is used by algorithms
 * which store information about the cost from the cost and use a heuristic function
 * to estimate the cost to the goal.
 *
 * @param <A> type of the actions
 * @param <S> type of the state
 * @param <C> type of the cost (must extend {@link java.lang.Comparable})
 * @param <N> node type
 *
 * @author Pablo Rodríguez Mier <<a href="mailto:pablo.rodriguez.mier@usc.es">pablo.rodriguez.mier@usc.es</a>>
 * @author Adrián González Sieira <<a href="adrian.gonzalez@usc.es">adrian.gonzalez@usc.es</a>>
 */
public interface HeuristicNode<A,S,C extends Comparable<C>, N extends HeuristicNode<A,S,C,N>> extends CostNode<A,S,C,N> {

    /**
     * Retrieves the total cost (typically f = g + h) of this node,
     * where g = {@link HeuristicNode#getCost()} and
     * h = {@link HeuristicNode#getEstimation()}
     *
     * @return total cost (f function).
     */
    C getScore();

    /**
     * Return the estimated cost to goal state from the current state.
     * @return cost estimation.
     */
    C getEstimation();
}


================================================
FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/Node.java
================================================
/*
 * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package es.usc.citius.hipster.model;

import java.util.List;

/**
 * A node encapsulates the information generated by the search algorithms during their execution. As different
 * type of algorithms exist (uninfo
Download .txt
gitextract_rn2ka7pn/

├── .config/
│   ├── deploy-artifacts.sh
│   ├── maven-settings.xml
│   └── publish-javadocs.sh
├── .github/
│   └── workflows/
│       └── maven.yml
├── .gitignore
├── .gitlab-sync
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── hipster-all/
│   ├── pom.xml
│   └── src/
│       └── main/
│           └── java/
│               └── es/
│                   └── usc/
│                       └── citius/
│                           └── hipster/
│                               └── all/
│                                   └── package-info.java
├── hipster-core/
│   ├── pom.xml
│   └── src/
│       ├── main/
│       │   └── java/
│       │       └── es/
│       │           └── usc/
│       │               └── citius/
│       │                   ├── hipster/
│       │                   │   ├── algorithm/
│       │                   │   │   ├── ADStarForward.java
│       │                   │   │   ├── AStar.java
│       │                   │   │   ├── Algorithm.java
│       │                   │   │   ├── BellmanFord.java
│       │                   │   │   ├── BreadthFirstSearch.java
│       │                   │   │   ├── DepthFirstSearch.java
│       │                   │   │   ├── DepthLimitedSearch.java
│       │                   │   │   ├── Hipster.java
│       │                   │   │   ├── IDAStar.java
│       │                   │   │   ├── MultiobjectiveLS.java
│       │                   │   │   ├── NegativeCycleException.java
│       │                   │   │   ├── localsearch/
│       │                   │   │   │   ├── AnnealingSearch.java
│       │                   │   │   │   ├── HillClimbing.java
│       │                   │   │   │   └── package-info.java
│       │                   │   │   └── package-info.java
│       │                   │   ├── graph/
│       │                   │   │   ├── DirectedEdge.java
│       │                   │   │   ├── GraphBuilder.java
│       │                   │   │   ├── GraphEdge.java
│       │                   │   │   ├── GraphSearchProblem.java
│       │                   │   │   ├── HashBasedHipsterDirectedGraph.java
│       │                   │   │   ├── HashBasedHipsterGraph.java
│       │                   │   │   ├── HipsterDirectedGraph.java
│       │                   │   │   ├── HipsterGraph.java
│       │                   │   │   ├── HipsterMutableGraph.java
│       │                   │   │   ├── Pair.java
│       │                   │   │   ├── UndirectedEdge.java
│       │                   │   │   ├── UniqueEdge.java
│       │                   │   │   ├── UnorderedPair.java
│       │                   │   │   └── package-info.java
│       │                   │   ├── model/
│       │                   │   │   ├── ADStarNode.java
│       │                   │   │   ├── AbstractNode.java
│       │                   │   │   ├── CostNode.java
│       │                   │   │   ├── HeuristicNode.java
│       │                   │   │   ├── Node.java
│       │                   │   │   ├── SimpleTransition.java
│       │                   │   │   ├── Transition.java
│       │                   │   │   ├── function/
│       │                   │   │   │   ├── ActionFunction.java
│       │                   │   │   │   ├── ActionStateTransitionFunction.java
│       │                   │   │   │   ├── BinaryFunction.java
│       │                   │   │   │   ├── CostFunction.java
│       │                   │   │   │   ├── HeuristicFunction.java
│       │                   │   │   │   ├── NodeExpander.java
│       │                   │   │   │   ├── NodeFactory.java
│       │                   │   │   │   ├── ScalarFunction.java
│       │                   │   │   │   ├── TransitionFunction.java
│       │                   │   │   │   ├── impl/
│       │                   │   │   │   │   ├── ADStarNodeExpander.java
│       │                   │   │   │   │   ├── ADStarNodeFactory.java
│       │                   │   │   │   │   ├── ADStarNodeUpdater.java
│       │                   │   │   │   │   ├── BinaryOperation.java
│       │                   │   │   │   │   ├── LazyActionStateTransitionFunction.java
│       │                   │   │   │   │   ├── LazyNodeExpander.java
│       │                   │   │   │   │   ├── Product.java
│       │                   │   │   │   │   ├── ScalarOperation.java
│       │                   │   │   │   │   ├── StateTransitionFunction.java
│       │                   │   │   │   │   ├── WeightedNodeFactory.java
│       │                   │   │   │   │   └── package-info.java
│       │                   │   │   │   └── package-info.java
│       │                   │   │   ├── impl/
│       │                   │   │   │   ├── ADStarNodeImpl.java
│       │                   │   │   │   ├── UnweightedNode.java
│       │                   │   │   │   ├── WeightedNode.java
│       │                   │   │   │   └── package-info.java
│       │                   │   │   ├── package-info.java
│       │                   │   │   └── problem/
│       │                   │   │       ├── ProblemBuilder.java
│       │                   │   │       ├── SearchComponents.java
│       │                   │   │       ├── SearchProblem.java
│       │                   │   │       └── package-info.java
│       │                   │   └── util/
│       │                   │       ├── F.java
│       │                   │       ├── Function.java
│       │                   │       ├── Iterators.java
│       │                   │       ├── Predicate.java
│       │                   │       └── examples/
│       │                   │           ├── RomanianProblem.java
│       │                   │           ├── maze/
│       │                   │           │   ├── Maze2D.java
│       │                   │           │   ├── MazeSearch.java
│       │                   │           │   ├── Mazes.java
│       │                   │           │   └── package-info.java
│       │                   │           └── package-info.java
│       │                   └── lab/
│       │                       └── hipster/
│       │                           └── collections/
│       │                               ├── FibonacciHeap.java
│       │                               ├── HashQueue.java
│       │                               ├── adapter/
│       │                               │   ├── HeuristicNodePriorityEvaluator.java
│       │                               │   ├── PriorityEvaluator.java
│       │                               │   ├── PriorityFibonacciQueue.java
│       │                               │   └── package-info.java
│       │                               └── package-info.java
│       └── test/
│           └── java/
│               └── es/
│                   └── usc/
│                       └── citius/
│                           ├── hipster/
│                           │   ├── algorithm/
│                           │   │   └── problem/
│                           │   │       └── romanian/
│                           │   │           ├── ADStarRomaniaProblemOptimalSearchTest.java
│                           │   │           ├── AStarRomaniaProblemOptimalSearchTest.java
│                           │   │           ├── BellmanFordRomaniaProblemOptimalSearchTest.java
│                           │   │           ├── DijkstraRomaniaProblemOptimalSearchTest.java
│                           │   │           ├── IDAStarRomaniaProblemOptimalSearchTest.java
│                           │   │           ├── RomaniaProblemOptimalHeuristicSearchTest.java
│                           │   │           └── RomaniaProblemOptimalSearchTest.java
│                           │   ├── graph/
│                           │   │   ├── HashBasedHipsterDirectedGraphTest.java
│                           │   │   ├── HashBasedHipsterGraphTest.java
│                           │   │   └── UndirectedEdgeTest.java
│                           │   └── util/
│                           │       └── graph/
│                           │           ├── GraphBuilderTest.java
│                           │           └── RomanianProblemGraph.java
│                           └── lab/
│                               └── hipster/
│                                   ├── algorithm/
│                                   │   ├── BellmanFordTest.java
│                                   │   ├── DepthFirstSearchTest.java
│                                   │   ├── DepthLimitedSearchTest.java
│                                   │   └── MultiobjectiveShortestPathTest.java
│                                   ├── collection/
│                                   │   └── HashQueueTest.java
│                                   └── maze/
│                                       └── Maze2DTest.java
├── hipster-examples/
│   ├── pom.xml
│   └── src/
│       ├── main/
│       │   └── java/
│       │       └── es/
│       │           └── usc/
│       │               └── citius/
│       │                   └── hipster/
│       │                       └── examples/
│       │                           ├── ASCIIMazeVisualizer.form
│       │                           ├── ASCIIMazeVisualizer.java
│       │                           ├── BlueprintsGraphMultiobjectiveSearch.java
│       │                           ├── DirectedGraphSearchExample.java
│       │                           ├── EightPuzzleProblemExample.java
│       │                           ├── EightQueensProblemExample.java
│       │                           ├── EightQueensProblemExampleWithAnnealingSearch.java
│       │                           ├── MazeShortestPathExample.java
│       │                           ├── RomanianProblemDFSExample.java
│       │                           ├── RomanianProblemExample.java
│       │                           ├── SimpleEightPuzzleExample.java
│       │                           ├── UndirectedGraphSearchExample.java
│       │                           ├── package-info.java
│       │                           └── problem/
│       │                               ├── NPuzzle.java
│       │                               ├── NQueens.java
│       │                               └── package-info.java
│       └── test/
│           └── java/
│               └── es/
│                   └── usc/
│                       └── citius/
│                           ├── hipster/
│                           │   └── search/
│                           │       └── local/
│                           │           └── NQueensEHCTest.java
│                           └── lab/
│                               └── hipster/
│                                   └── examples/
│                                       └── NQueensTest.java
├── hipster-extensions/
│   ├── pom.xml
│   └── src/
│       ├── main/
│       │   └── java/
│       │       └── es/
│       │           └── usc/
│       │               └── citius/
│       │                   └── hipster/
│       │                       └── extensions/
│       │                           └── graph/
│       │                               ├── HashTableHipsterDirectedGraph.java
│       │                               └── HashTableHipsterGraph.java
│       └── test/
│           └── java/
│               └── es/
│                   └── usc/
│                       └── citius/
│                           └── hipster/
│                               └── extensions/
│                                   └── graph/
│                                       ├── HashTableHipsterDirectedGraphTest.java
│                                       └── HashTableHipsterGraphTest.java
├── hipster-test/
│   └── pom.xml
├── hipster-third-party-graphs/
│   ├── pom.xml
│   └── src/
│       ├── main/
│       │   └── java/
│       │       └── es/
│       │           └── usc/
│       │               └── citius/
│       │                   └── hipster/
│       │                       └── thirdparty/
│       │                           └── graphs/
│       │                               ├── blueprints/
│       │                               │   ├── BlueprintsHipsterDirectedGraphAdapter.java
│       │                               │   ├── BlueprintsHipsterGraphAdapter.java
│       │                               │   └── package-info.java
│       │                               └── jung/
│       │                                   ├── JUNGHipsterDirectedGraphAdapter.java
│       │                                   ├── JUNGHipsterGraphAdapter.java
│       │                                   └── package-info.java
│       └── test/
│           └── java/
│               └── es/
│                   └── usc/
│                       └── citius/
│                           └── hipster/
│                               └── thirdparty/
│                                   └── graphs/
│                                       └── JUNGHipsterGraphAdapterTest.java
├── pom.xml
└── src/
    ├── main/
    │   ├── doclava/
    │   │   └── custom/
    │   │       └── assets/
    │   │           └── hipster-template/
    │   │               ├── assets/
    │   │               │   ├── customizations.css
    │   │               │   └── customizations.js
    │   │               ├── components/
    │   │               │   ├── api_filter.cs
    │   │               │   ├── left_nav.cs
    │   │               │   ├── masthead.cs
    │   │               │   └── search_box.cs
    │   │               ├── customizations.cs
    │   │               └── footer.cs
    │   └── javadoc/
    │       ├── overview.html
    │       └── stylesheet.css
    └── site/
        ├── markdown/
        │   ├── citation.md
        │   └── index.md
        ├── resources/
        │   └── css/
        │       └── site.css
        └── site.xml
Download .txt
SYMBOL INDEX (868 symbols across 112 files)

FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/ADStarForward.java
  class ADStarForward (line 58) | public class ADStarForward<A,S,C extends Comparable<C>, N extends es.usc...
    method ADStarForward (line 72) | public ADStarForward(S begin, S goal, ADStarNodeExpander<A, S, C, N> e...
    method ADStarForward (line 84) | public ADStarForward(S begin, Collection<S> goals, ADStarNodeExpander<...
    method iterator (line 90) | @Override
    class Iterator (line 98) | public class Iterator implements java.util.Iterator<N> {
      method Iterator (line 109) | protected Iterator() {
      method insertOpen (line 145) | protected void insertOpen(N node) {
      method takePromising (line 156) | protected N takePromising() {
      method updateQueues (line 173) | protected void updateQueues(N node) {
      method hasNext (line 200) | @Override
      method remove (line 210) | @Override
      method next (line 215) | @Override
      method getOpen (line 278) | public Map<S, N> getOpen() { return open; }
      method getClosed (line 287) | public Map<S, N> getClosed() { return closed; }
      method getIncons (line 289) | public Map<S, N> getIncons() { return incons; }
      method getGoalNodes (line 296) | public Collection<N> getGoalNodes() {
      method setEpsilon (line 310) | public void setEpsilon(double epsilon){
      method getEpsilon (line 320) | public double getEpsilon(){
      method addTransitionsChanged (line 329) | public void addTransitionsChanged(Collection<Transition<A, S>> trans...

FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/AStar.java
  class AStar (line 44) | public class AStar<A,S,C extends Comparable<C>,N extends HeuristicNode<A...
    method AStar (line 56) | public AStar(N initialNode, NodeExpander<A,S,N> expander) {
    method iterator (line 61) | @Override
    class Iterator (line 69) | public class Iterator implements java.util.Iterator<N> {
      method Iterator (line 74) | protected Iterator() {
      method hasNext (line 85) | public boolean hasNext() {
      method takePromising (line 89) | protected N takePromising() {
      method next (line 105) | public N next() {
      method remove (line 142) | public void remove() {
      method getOpen (line 153) | public Map<S, N> getOpen() {
      method setOpen (line 157) | public void setOpen(Map<S, N> open) {
      method getClosed (line 168) | public Map<S, N> getClosed() {
      method setClosed (line 178) | public void setClosed(Map<S, N> closed) {
      method getQueue (line 190) | public Queue<N> getQueue() {
      method setQueue (line 200) | public void setQueue(Queue<N> queue) {

FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/Algorithm.java
  class Algorithm (line 35) | public abstract class Algorithm<A,S,N extends Node<A,S,N>> implements It...
    class SearchResult (line 41) | public final class SearchResult {
      method SearchResult (line 47) | public SearchResult(N goalNode, int iterations, long elapsed) {
      method SearchResult (line 53) | public SearchResult(Collection<N> goalNodes, int iterations, long el...
      method getElapsed (line 63) | public long getElapsed() {
      method getIterations (line 71) | public int getIterations() {
      method getGoalNode (line 78) | public N getGoalNode() {
      method getGoalNodes (line 82) | public Collection<N> getGoalNodes() {
      method getOptimalPaths (line 86) | public List<List<S>> getOptimalPaths() {
      method toString (line 95) | @Override
    type SearchListener (line 118) | public interface SearchListener<N> {
      method handle (line 119) | void handle(N node);
    method search (line 127) | public SearchResult search(final S goalState){
    method search (line 147) | public SearchResult search(Predicate<N> condition){
    method search (line 183) | public void search(SearchListener<N> listener){
    method recoverStatePath (line 198) | public static <S, N extends Node<?,S,N>>  List<S> recoverStatePath(N n...
    method recoverActionPath (line 214) | public static <A, N extends Node<A,?,N>>  List<A> recoverActionPath(N ...

FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/BellmanFord.java
  class BellmanFord (line 47) | public class BellmanFord<A,S,C extends Comparable<C>,N extends CostNode<...
    method BellmanFord (line 52) | public BellmanFord(N initialNode, NodeExpander<A, S, N> nodeExpander) {
    class Iterator (line 62) | public class Iterator implements java.util.Iterator<N> {
      method Iterator (line 66) | protected Iterator(){
      method enqueue (line 79) | protected void enqueue(N node) {
      method dequeue (line 93) | protected N dequeue() {
      method hasNext (line 99) | @Override
      method next (line 104) | @Override
      method remove (line 129) | @Override
    method search (line 135) | @Override
    method iterator (line 158) | @Override
    method getInitialNode (line 163) | public N getInitialNode() {
    method setInitialNode (line 167) | public void setInitialNode(N initialNode) {
    method getNodeExpander (line 171) | public NodeExpander<A, S, N> getNodeExpander() {
    method setNodeExpander (line 175) | public void setNodeExpander(NodeExpander<A, S, N> nodeExpander) {
    method isCheckNegativeCycles (line 179) | public boolean isCheckNegativeCycles() {
    method setCheckNegativeCycles (line 183) | public void setCheckNegativeCycles(boolean checkNegativeCycles) {

FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/BreadthFirstSearch.java
  class BreadthFirstSearch (line 41) | public class BreadthFirstSearch<A,S,N extends Node<A,S,N>> extends Algor...
    method BreadthFirstSearch (line 45) | public BreadthFirstSearch(N initialNode, NodeExpander<A, S, N> expande...
    class Iterator (line 53) | public class Iterator implements java.util.Iterator<N> {
      method Iterator (line 61) | protected Iterator(){
      method hasNext (line 66) | @Override
      method next (line 71) | @Override
      method remove (line 84) | @Override
      method getQueue (line 91) | public Queue<N> getQueue() {
      method setQueue (line 95) | public void setQueue(Queue<N> queue) {
      method getVisited (line 99) | public Map<S, N> getVisited() {
      method setVisited (line 103) | public void setVisited(Map<S, N> visited) {
    method iterator (line 108) | @Override

FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/DepthFirstSearch.java
  class DepthFirstSearch (line 37) | public class DepthFirstSearch<A,S,N extends Node<A,S,N>> extends Algorit...
    method DepthFirstSearch (line 43) | public DepthFirstSearch(N initialNode, NodeExpander<A, S, N> expander) {
    class StackFrameNode (line 48) | public class StackFrameNode {
      method StackFrameNode (line 59) | StackFrameNode(java.util.Iterator successors, N node) {
      method StackFrameNode (line 64) | StackFrameNode(N node) {
      method getNode (line 69) | public N getNode() {
      method getSuccessors (line 73) | public java.util.Iterator<N> getSuccessors() {
      method isVisited (line 77) | public boolean isVisited() {
      method isProcessed (line 81) | public boolean isProcessed() {
    class Iterator (line 89) | public class Iterator implements java.util.Iterator<N> {
      method Iterator (line 95) | protected Iterator(){
      method hasNext (line 100) | @Override
      method next (line 110) | @Override
      method remove (line 128) | @Override
      method nextUnvisited (line 134) | protected StackFrameNode nextUnvisited(){
      method processNextNode (line 151) | protected StackFrameNode processNextNode(){
      method getStack (line 174) | public Deque<StackFrameNode> getStack() {
      method setStack (line 178) | public void setStack(Deque<StackFrameNode> stack) {
      method getNext (line 182) | public StackFrameNode getNext() {
      method setNext (line 186) | public void setNext(StackFrameNode next) {
      method getClosed (line 190) | public Set<S> getClosed() {
      method setClosed (line 194) | public void setClosed(Set<S> closed) {
      method isGraphSupport (line 198) | public boolean isGraphSupport() {
      method setGraphSupport (line 202) | public void setGraphSupport(boolean graphSupport) {
    method iterator (line 206) | @Override

FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/DepthLimitedSearch.java
  class DepthLimitedSearch (line 36) | public class DepthLimitedSearch <A,S,N extends Node<A,S,N>> extends Algo...
    method DepthLimitedSearch (line 44) | public DepthLimitedSearch(N initialNode, N finalNode, NodeExpander nod...
    method getMaximumDepth (line 53) | public int getMaximumDepth() {
    method getCurrentDepth (line 57) | public int getCurrentDepth() {
    method getPath (line 61) | public ArrayList<S> getPath() {
    method incrementCurrentDepth (line 65) | public void incrementCurrentDepth() {
    method execute (line 69) | public boolean execute() {
    class StackNode (line 96) | private class StackNode {
      method StackNode (line 100) | public StackNode(N node) {
      method getNode (line 105) | public N getNode() {
      method setNode (line 109) | public void setNode(N node) {
      method getChildren (line 113) | public List<StackNode> getChildren() {
      method setChildren (line 122) | public void setChildren(java.util.Iterator<N> children) {
    method iterator (line 127) | @Override

FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/Hipster.java
  class Hipster (line 50) | public final class Hipster {
    method Hipster (line 52) | private Hipster() {
    method createAStar (line 72) | public static <A, S, C extends Comparable<C>, N extends HeuristicNode<...
    method createDijkstra (line 94) | public static <A, S, C extends Comparable<C>, N extends HeuristicNode<...
    method createBellmanFord (line 118) | public static <A, S, C extends Comparable<C>, N extends CostNode<A, S,...
    method createBreadthFirstSearch (line 138) | public static <A, S, N extends Node<A, S, N>> BreadthFirstSearch<A, S,...
    method createDepthFirstSearch (line 158) | public static <A, S, N extends Node<A, S, N>> DepthFirstSearch<A, S, N...
    method createDepthLimitedSearch (line 178) | public static <A, S, N extends Node<A, S, N>> DepthLimitedSearch<A, S,...
    method createIDAStar (line 200) | public static <A, S, C extends Comparable<C>, N extends HeuristicNode<...
    method createHillClimbing (line 225) | public static <A, S, C extends Comparable<C>, N extends HeuristicNode<...
    method createAnnealingSearch (line 249) | public static <A, S, N extends HeuristicNode<A, S, Double, N>> Anneali...
    method createMultiobjectiveLS (line 274) | public static <A, S, C extends Comparable<C>, N extends HeuristicNode<...
    method createADStar (line 295) | public static <A, S, C extends Comparable<C>> ADStarForward<A, S, C, A...

FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/IDAStar.java
  class IDAStar (line 44) | public class IDAStar<A,S,C extends Comparable<C>,N extends HeuristicNode...
    method IDAStar (line 51) | public IDAStar(N initialNode, NodeExpander<A,S,N> expander) {
    class Iterator (line 62) | public class Iterator extends DepthFirstSearch.Iterator {
      method Iterator (line 67) | protected Iterator(){
      method updateMinFLimit (line 74) | protected void updateMinFLimit(C currentFLimit){
      method nextUnvisited (line 84) | @Override
      method processNextNode (line 108) | @Override
      method getfLimit (line 152) | public C getfLimit() {
      method setfLimit (line 156) | public void setfLimit(C fLimit) {
      method getMinfLimit (line 160) | public C getMinfLimit() {
      method setMinfLimit (line 164) | public void setMinfLimit(C minfLimit) {
      method getReinitialization (line 168) | public int getReinitialization() {
      method setReinitialization (line 172) | public void setReinitialization(int reinitialization) {
    method iterator (line 177) | @Override

FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/MultiobjectiveLS.java
  class MultiobjectiveLS (line 39) | public class MultiobjectiveLS<A,S,C extends Comparable<C>,N extends Heur...
    method MultiobjectiveLS (line 44) | public MultiobjectiveLS(N initialNode, NodeExpander<A, S, N> nodeExpan...
    class Iterator (line 56) | public class Iterator implements java.util.Iterator<N> {
      method Iterator (line 62) | protected Iterator(){
      method hasNext (line 68) | public boolean hasNext() {
      method next (line 72) | @Override
      method remove (line 112) | @Override
      method dominatedBy (line 117) | protected Collection<N> dominatedBy(N node, Iterable<N> nonDominated) {
      method isDominated (line 127) | protected boolean isDominated(N node, Iterable<N> nonDominated) {
      method getQueue (line 137) | public Queue<N> getQueue() {
      method getNonDominated (line 141) | public Map<S, Collection<N>> getNonDominated() {
    method search (line 146) | @Override
    method iterator (line 168) | @Override

FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/NegativeCycleException.java
  class NegativeCycleException (line 4) | public class NegativeCycleException extends RuntimeException {
    method NegativeCycleException (line 7) | public NegativeCycleException() {

FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/localsearch/AnnealingSearch.java
  class AnnealingSearch (line 56) | public class AnnealingSearch<A, S, N extends HeuristicNode<A, S, Double,...
    method AnnealingSearch (line 70) | public AnnealingSearch(N initialNode, NodeExpander<A, S, N> nodeExpand...
    method iterator (line 126) | @Override
    class ASIterator (line 132) | public class ASIterator implements Iterator<N> {
      method ASIterator (line 138) | private ASIterator() {
      method hasNext (line 143) | @Override
      method next (line 148) | @Override
      method remove (line 172) | @Override
    type AcceptanceProbability (line 187) | public interface AcceptanceProbability {
      method compute (line 188) | Double compute(Double oldScore, Double newScore, Double temp);
    type SuccessorFinder (line 196) | public interface SuccessorFinder<A, S, N extends Node<A, S, N>> {
      method estimate (line 201) | N estimate(N node, NodeExpander<A, S, N> nodeExpander);

FILE: hipster-core/src/main/java/es/usc/citius/hipster/algorithm/localsearch/HillClimbing.java
  class HillClimbing (line 52) | public class HillClimbing<A,S,C extends Comparable<C>,N extends Heuristi...
    method HillClimbing (line 58) | public HillClimbing(N initialNode, NodeExpander<A, S, N> nodeExpander) {
    method HillClimbing (line 70) | public HillClimbing(N initialNode, NodeExpander<A, S, N> nodeExpander,...
    class EHCIterator (line 76) | public class EHCIterator implements Iterator<N> {
      method EHCIterator (line 80) | private EHCIterator() {
      method hasNext (line 85) | @Override
      method next (line 90) | @Override
      method remove (line 126) | @Override
      method getQueue (line 134) | public Queue<N> getQueue() {
      method setQueue (line 141) | public void setQueue(Queue<N> queue) {
      method getBestScore (line 148) | public C getBestScore() {
      method setBestScore (line 155) | public void setBestScore(C bestScore) {
    method iterator (line 161) | @Override

FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/DirectedEdge.java
  class DirectedEdge (line 3) | public class DirectedEdge<V,E> implements GraphEdge<V,E> {
    method DirectedEdge (line 8) | public DirectedEdge(V vertex1, V vertex2, E value) {
    method getVertex1 (line 13) | @Override
    method getVertex2 (line 18) | @Override
    method getEdgeValue (line 23) | @Override
    method getType (line 28) | @Override
    method equals (line 33) | @Override
    method hashCode (line 45) | @Override

FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/GraphBuilder.java
  class GraphBuilder (line 35) | public class GraphBuilder<V, E> {
    class Connection (line 37) | private class Connection {
      method Connection (line 42) | private Connection(V vertex1, V vertex2, E edge) {
      method Connection (line 48) | private Connection(V vertex1, V vertex2) {
      method getVertex1 (line 54) | public V getVertex1() {
      method setVertex1 (line 58) | public void setVertex1(V vertex1) {
      method getVertex2 (line 62) | public V getVertex2() {
      method setVertex2 (line 66) | public void setVertex2(V vertex2) {
      method getEdge (line 70) | public E getEdge() {
      method setEdge (line 74) | public void setEdge(E edge) {
      method equals (line 78) | @Override
    method GraphBuilder (line 93) | private GraphBuilder() {}
    method create (line 95) | public static <V, E> GraphBuilder<V,E> create() {
    method connect (line 99) | public Vertex1 connect(V vertex) {
    method connect (line 103) | public GraphBuilder<V, E> connect(V vertex1, V vertex2) {
    method createDirectedGraph (line 109) | public HipsterDirectedGraph<V,E> createDirectedGraph() {
    method createUndirectedGraph (line 119) | public HipsterGraph<V,E> createUndirectedGraph() {
    method buildDirectedGraph (line 133) | @Deprecated
    method buildUndirectedGraph (line 142) | @Deprecated
    class Vertex1 (line 148) | public final class Vertex1 {
      method Vertex1 (line 151) | private Vertex1(V vertex) {
      method to (line 155) | public Vertex2 to(V vertex) {
      class Vertex2 (line 159) | public class Vertex2 {
        method Vertex2 (line 162) | private Vertex2(V vertex) {
        method withEdge (line 167) | public GraphBuilder<V, E> withEdge(E edge) {

FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/GraphEdge.java
  type GraphEdge (line 27) | public interface GraphEdge<V,E> {
    type Type (line 28) | enum Type { DIRECTED, UNDIRECTED }
    method getVertex1 (line 30) | V getVertex1();
    method getVertex2 (line 31) | V getVertex2();
    method getEdgeValue (line 32) | E getEdgeValue();
    method getType (line 33) | Type getType();

FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/GraphSearchProblem.java
  class GraphSearchProblem (line 43) | public final class GraphSearchProblem {
    method startingFrom (line 45) | public static <V> FromVertex<V> startingFrom(V vertex) {
    class FromVertex (line 49) | public static class FromVertex<V> {
      method goalAt (line 53) | public FromVertex<V> goalAt(V vertex) {
      method FromVertex (line 58) | private FromVertex(V fromVertex) {
      method in (line 62) | public <E> CostType<E> in(final HipsterGraph<V, E> graph) {
      method inGraphWithLexicographicalOrder (line 92) | public <E> CostType<E> inGraphWithLexicographicalOrder(final Hipster...
      class CostType (line 133) | public class CostType<E> {
        method CostType (line 136) | private CostType(TransitionFunction<E, V> tf) {
        method takeCostsFromEdges (line 140) | public HeuristicType<Double> takeCostsFromEdges() {
        method extractCostFromEdges (line 174) | public HeuristicType<Double> extractCostFromEdges(final Function<E...
        method useGenericCosts (line 184) | public <C extends Comparable<C>> HeuristicType<C> useGenericCosts(...
        method build (line 194) | public SearchProblem<E, V, UnweightedNode<E, V>> build() {
        class HeuristicType (line 202) | public class HeuristicType<C extends Comparable<C>> {
          method HeuristicType (line 207) | private HeuristicType(CostFunction<E, V, C> cf, BinaryOperation<...
          method useScaleAlgebra (line 212) | public HeuristicType<C> useScaleAlgebra(ScalarOperation<C> scale...
          method useHeuristicFunction (line 217) | public Final useHeuristicFunction(HeuristicFunction<V, C> hf) {
          method build (line 221) | public SearchProblem<E, V, WeightedNode<E, V, C>> build() {
          class Final (line 230) | public class Final {
            method Final (line 233) | private Final(HeuristicFunction<V, C> hf) {
            method components (line 237) | public SearchComponents<E, V, C> components(){
            method build (line 241) | public SearchProblem<E, V, WeightedNode<E, V, C>> build() {

FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/HashBasedHipsterDirectedGraph.java
  class HashBasedHipsterDirectedGraph (line 29) | public class HashBasedHipsterDirectedGraph<V, E> extends HashBasedHipste...
    method buildEdge (line 32) | @Override
    method outgoingEdgesOf (line 37) | @Override
    method incomingEdgesOf (line 47) | @Override
    method edges (line 57) | @Override
    method create (line 76) | public static <V, E> HashBasedHipsterDirectedGraph<V, E> create() {

FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/HashBasedHipsterGraph.java
  class HashBasedHipsterGraph (line 29) | public class HashBasedHipsterGraph<V,E> implements HipsterMutableGraph<V...
    method HashBasedHipsterGraph (line 32) | public HashBasedHipsterGraph(){
    method add (line 36) | @Override
    method add (line 46) | @Override
    method remove (line 55) | @Override
    method remove (line 78) | @Override
    method connect (line 87) | @Override
    method buildEdge (line 101) | public GraphEdge<V,E> buildEdge(V v1, V v2, E value){
    method createEntry (line 105) | private Map.Entry<V, GraphEdge<V,E>> createEntry(final V vertex, final...
    method vedges (line 124) | protected Iterable<Map.Entry<V, GraphEdge<V,E>>> vedges(){
    method edges (line 142) | @Override
    method vertices (line 157) | @Override
    method edgesOf (line 162) | @Override
    method getConnected (line 173) | public HashMap<V, Set<GraphEdge<V, E>>> getConnected() {
    method setConnected (line 177) | public void setConnected(HashMap<V, Set<GraphEdge<V, E>>> connected) {
    method create (line 181) | public static <V,E> HashBasedHipsterGraph<V, E> create() {

FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/HipsterDirectedGraph.java
  type HipsterDirectedGraph (line 25) | public interface HipsterDirectedGraph<V,E> extends HipsterGraph<V,E> {
    method outgoingEdgesOf (line 26) | Iterable<GraphEdge<V,E>> outgoingEdgesOf(V vertex);
    method incomingEdgesOf (line 27) | Iterable<GraphEdge<V,E>> incomingEdgesOf(V vertex);

FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/HipsterGraph.java
  type HipsterGraph (line 24) | public interface HipsterGraph<V,E> {
    method edges (line 29) | Iterable<GraphEdge<V,E>> edges();
    method vertices (line 35) | Iterable<V> vertices();
    method edgesOf (line 42) | Iterable<GraphEdge<V,E>> edgesOf(V vertex);

FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/HipsterMutableGraph.java
  type HipsterMutableGraph (line 11) | public interface HipsterMutableGraph<V,E> extends HipsterGraph<V,E> {
    method add (line 17) | boolean add(V vertex);
    method add (line 24) | Set<V> add(V... vertices);
    method remove (line 31) | boolean remove(V vertex);
    method remove (line 38) | Set<V> remove(V... vertices);
    method connect (line 47) | GraphEdge<V,E> connect(V vertex1, V vertex2, E edgeValue);

FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/Pair.java
  class Pair (line 4) | public class Pair<E> {
    method Pair (line 7) | public Pair(E e1, E e2) {
    method _1 (line 14) | public E _1() {
    method _2 (line 18) | public E _2() {
    method getE1 (line 22) | public E getE1() {
    method setE1 (line 26) | public void setE1(E e1) {
    method getE2 (line 30) | public E getE2() {
    method setE2 (line 34) | public void setE2(E e2) {
    method equals (line 38) | @Override
    method hashCode (line 50) | @Override
    method toString (line 57) | @Override

FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/UndirectedEdge.java
  class UndirectedEdge (line 4) | public class UndirectedEdge<V,E> implements GraphEdge<V,E> {
    method UndirectedEdge (line 9) | public UndirectedEdge(V vertex1, V vertex2, E value) {
    method getVertex1 (line 14) | @Override
    method getVertex2 (line 19) | @Override
    method getEdgeValue (line 24) | @Override
    method getType (line 29) | @Override
    method equals (line 34) | @Override
    method hashCode (line 46) | @Override

FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/UniqueEdge.java
  class UniqueEdge (line 28) | public class UniqueEdge<V> {
    method UniqueEdge (line 33) | public UniqueEdge(V value) {
    method getValue (line 38) | public V getValue() {
    method setValue (line 42) | public void setValue(V value) {
    method getEdgeId (line 46) | public String getEdgeId() {
    method create (line 50) | public static <V> UniqueEdge<V> create(V value){
    method equals (line 54) | @Override
    method hashCode (line 67) | @Override
    method toString (line 74) | @Override

FILE: hipster-core/src/main/java/es/usc/citius/hipster/graph/UnorderedPair.java
  class UnorderedPair (line 3) | public class UnorderedPair<E> {
    method UnorderedPair (line 6) | public UnorderedPair(E e1, E e2) {
    method contains (line 13) | public boolean contains(Object vertex){
    method getE1 (line 17) | public E getE1() {
    method setE1 (line 21) | public void setE1(E e1) {
    method getE2 (line 25) | public E getE2() {
    method setE2 (line 29) | public void setE2(E e2) {
    method equals (line 33) | @Override
    method hashCode (line 42) | @Override
    method toString (line 47) | @Override

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/ADStarNode.java
  type ADStarNode (line 19) | public interface ADStarNode<A, S, C extends Comparable<C>, N extends ADS...
    method getG (line 24) | public C getG();
    method getV (line 29) | public C getV();
    method isDoUpdate (line 34) | public boolean isDoUpdate();
    method isConsistent (line 39) | public boolean isConsistent();
    method setG (line 44) | public void setG(C g);
    method setV (line 49) | public void setV(C v);
    method setDoUpdate (line 54) | public void setDoUpdate(boolean update);
    method setKey (line 59) | public void setKey(Key<C> key);
    method getKey (line 64) | public Key<C> getKey();
    method setPreviousNode (line 69) | public void setPreviousNode(N parent);
    method setState (line 74) | public void setState(S state);
    method setAction (line 79) | public void setAction(A action);
    class Key (line 86) | public static class Key<C extends Comparable<C>> implements Comparable...
      method Key (line 100) | public Key(C g, C v, C h, double e, BinaryOperation<C> add, ScalarFu...
      method update (line 108) | public void update(C g, C v, C h, double e, BinaryOperation<C> add, ...
      method calculate (line 115) | private void calculate(C g, C v, C h, double e, BinaryOperation<C> a...
      method Key (line 132) | public Key(C first, C second){
      method compareTo (line 143) | public int compareTo(Key<C> o) {
      method getFirst (line 155) | public C getFirst() {
      method getSecond (line 162) | public C getSecond() {

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/AbstractNode.java
  class AbstractNode (line 35) | public class AbstractNode<A,S,N extends AbstractNode<A,S,N>> implements ...
    method AbstractNode (line 48) | public AbstractNode(N previousNode, S state, A action) {
    method path (line 55) | @Override
    method pathSize (line 66) | @Override
    method previousNode (line 71) | @Override
    method state (line 76) | @Override
    method action (line 81) | @Override
    method toString (line 86) | @Override

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/CostNode.java
  type CostNode (line 34) | public interface CostNode<A,S,C extends Comparable<C>,N extends CostNode...
    method getCost (line 39) | C getCost();

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/HeuristicNode.java
  type HeuristicNode (line 34) | public interface HeuristicNode<A,S,C extends Comparable<C>, N extends He...
    method getScore (line 43) | C getScore();
    method getEstimation (line 49) | C getEstimation();

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/Node.java
  type Node (line 34) | public interface Node<A,S,N extends Node<A,S,N>> {
    method path (line 42) | List<N> path();
    method pathSize (line 49) | int pathSize();
    method previousNode (line 56) | N previousNode();
    method state (line 62) | S state();
    method action (line 68) | A action();

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/SimpleTransition.java
  class SimpleTransition (line 28) | public class SimpleTransition<S> extends Transition<Void, S> {
    method SimpleTransition (line 36) | public SimpleTransition(S state) {
    method SimpleTransition (line 47) | public SimpleTransition(S fromState, S toState) {

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/Transition.java
  class Transition (line 34) | public class Transition<A,S> {
    method Transition (line 49) | public Transition(A action, S state) {
    method Transition (line 64) | public Transition(S fromState, A action, S toState) {
    method create (line 81) | public static <A,S> Transition<A,S> create(S fromState, A action, S to...
    method create (line 94) | public static <S> Transition<Void,S> create(S fromState, S toState){
    method getAction (line 101) | public A getAction() {
    method setAction (line 108) | public void setAction(A action) {
    method getState (line 115) | public S getState() {
    method setState (line 122) | public void setState(S state) {
    method getFromState (line 129) | public S getFromState() {
    method toString (line 133) | @Override

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/function/ActionFunction.java
  type ActionFunction (line 28) | public interface ActionFunction<A,S> {
    method actionsFor (line 34) | Iterable<A> actionsFor(S state);

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/function/ActionStateTransitionFunction.java
  type ActionStateTransitionFunction (line 29) | public interface ActionStateTransitionFunction<A,S> {
    method apply (line 36) | S apply(A action, S state);

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/function/BinaryFunction.java
  type BinaryFunction (line 46) | public interface BinaryFunction<T> {
    method apply (line 56) | T apply(T a, T b);

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/function/CostFunction.java
  type CostFunction (line 30) | public interface CostFunction<A, S, C extends Comparable<C>> {
    method evaluate (line 32) | public C evaluate(Transition<A,S> transition);

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/function/HeuristicFunction.java
  type HeuristicFunction (line 27) | public interface HeuristicFunction<S,C> {
    method estimate (line 28) | C estimate(S state);

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/function/NodeExpander.java
  type NodeExpander (line 29) | public interface NodeExpander<A,S,N extends Node<A,S,N>> {
    method expand (line 31) | Iterable<N> expand(N node);

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/function/NodeFactory.java
  type NodeFactory (line 29) | public interface NodeFactory<A,S,N> {
    method makeNode (line 30) | N makeNode(N fromNode, Transition<A,S> transition);

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/function/ScalarFunction.java
  type ScalarFunction (line 47) | public interface ScalarFunction<T> {
    method scale (line 56) | T scale(T a, double b);

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/function/TransitionFunction.java
  type TransitionFunction (line 33) | public interface TransitionFunction<A,S> {
    method transitionsFrom (line 41) | Iterable<Transition<A,S>> transitionsFrom(S state);

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/ADStarNodeExpander.java
  class ADStarNodeExpander (line 35) | public class ADStarNodeExpander<A, S, C extends Comparable<C>, N extends...
    method ADStarNodeExpander (line 58) | public ADStarNodeExpander(SearchComponents<A, S, C> components, NodeFa...
    method ADStarNodeExpander (line 76) | public ADStarNodeExpander(TransitionFunction<A, S> successorFunction, ...
    method setNodeConsistent (line 91) | public void setNodeConsistent(boolean nodeConsistent) {
    method expand (line 95) | @Override
    method expandTransitionsChanged (line 135) | public Iterable<N> expandTransitionsChanged(N begin, Iterable<Transiti...
    method updateConsistent (line 165) | private boolean updateConsistent(N node, N parent, Transition<A, S> tr...
    method updateInconsistent (line 190) | private boolean updateInconsistent(N node, Map<Transition<A, S>, N> pr...
    method predecessorsMap (line 221) | private Map<Transition<A, S>, N> predecessorsMap(S current){
    method setMaxV (line 239) | public void setMaxV(N node) {
    method setMaxG (line 248) | public void setMaxG(N node)  {
    method setEpsilon (line 257) | public void setEpsilon(double epsilon) {
    method getEpsilon (line 266) | public double getEpsilon() {
    method getVisited (line 273) | public Map<S, N> getVisited() { return visited; }
    method clearVisited (line 278) | public void clearVisited() { this.visited = new HashMap<S, N>(); }
    method makeNode (line 287) | public N makeNode(N from, Transition<A, S> transition){
    method updateKey (line 294) | public void updateKey(N node){
    method setMaxKey (line 298) | public void setMaxKey(N node){

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/ADStarNodeFactory.java
  class ADStarNodeFactory (line 33) | public class ADStarNodeFactory<A, S, C extends Comparable<C>> implements...
    method ADStarNodeFactory (line 50) | public ADStarNodeFactory(BinaryOperation<C> addOp, ScalarOperation<C> ...
    method ADStarNodeFactory (line 64) | public ADStarNodeFactory(SearchComponents<A, S, C> components){
    method makeNode (line 68) | @Override

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/ADStarNodeUpdater.java
  class ADStarNodeUpdater (line 48) | public class ADStarNodeUpdater<A, S, C extends Comparable<C>> {
    method ADStarNodeUpdater (line 67) | public ADStarNodeUpdater(CostFunction<A, S, C> costFunction,

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/BinaryOperation.java
  class BinaryOperation (line 33) | public class BinaryOperation<E extends Comparable<E>> implements BinaryF...
    method BinaryOperation (line 46) | public BinaryOperation(BinaryFunction<E> operation, E identityElem, E ...
    method apply (line 59) | @Override
    method getMaxElem (line 67) | public E getMaxElem() {
    method getIdentityElem (line 74) | public E getIdentityElem() {
    method doubleAdditionOp (line 82) | public static BinaryOperation<Double> doubleAdditionOp() {
    method doubleMultiplicationOp (line 94) | public static BinaryOperation<Double> doubleMultiplicationOp() {

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/LazyActionStateTransitionFunction.java
  class LazyActionStateTransitionFunction (line 40) | public class LazyActionStateTransitionFunction<A,S> implements Transitio...
    method LazyActionStateTransitionFunction (line 50) | public LazyActionStateTransitionFunction(ActionFunction<A, S> af, Acti...
    method transitionsFrom (line 55) | @Override

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/LazyNodeExpander.java
  class LazyNodeExpander (line 40) | public class LazyNodeExpander<A,S,N extends Node<A,S,N>> implements Node...
    method LazyNodeExpander (line 51) | public LazyNodeExpander(TransitionFunction<A, S> tf, NodeFactory<A, S,...
    method expand (line 56) | @Override
    method getTransitionFunction (line 72) | public TransitionFunction<A, S> getTransitionFunction() {
    method getNodeFactory (line 79) | public NodeFactory<A, S, N> getNodeFactory() {

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/Product.java
  class Product (line 29) | public class Product implements ScalarFunction<Double> {
    method scale (line 38) | public Double scale(Double a, double b) {

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/ScalarOperation.java
  class ScalarOperation (line 18) | public class ScalarOperation<E extends Comparable<E>> implements ScalarF...
    method ScalarOperation (line 30) | public ScalarOperation(ScalarFunction<E> operation, double identityEle...
    method scale (line 35) | @Override
    method getIdentityElem (line 43) | public double getIdentityElem() {
    method doubleMultiplicationOp (line 53) | public static ScalarOperation<Double> doubleMultiplicationOp() {

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/StateTransitionFunction.java
  class StateTransitionFunction (line 38) | public abstract class StateTransitionFunction<S> implements TransitionFu...
    method transitionsFrom (line 40) | @Override
    method successorsOf (line 57) | public abstract Iterable<S> successorsOf(S state);

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/WeightedNodeFactory.java
  class WeightedNodeFactory (line 42) | public class WeightedNodeFactory<A,S,C extends Comparable<C>> implements...
    method WeightedNodeFactory (line 56) | public WeightedNodeFactory(CostFunction<A, S, C> costFunction, Heurist...
    method WeightedNodeFactory (line 69) | public WeightedNodeFactory(CostFunction<A, S, C> costFunction, BinaryO...
    method makeNode (line 79) | @Override

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/impl/ADStarNodeImpl.java
  class ADStarNodeImpl (line 19) | public class ADStarNodeImpl<A, S, C extends Comparable<C>>
    method ADStarNodeImpl (line 39) | public ADStarNodeImpl(Transition<A, S> transition, ADStarNodeImpl<A, S...
    method getG (line 51) | @Override
    method getV (line 61) | @Override
    method isDoUpdate (line 66) | @Override
    method setG (line 71) | @Override
    method setV (line 76) | @Override
    method setKey (line 81) | @Override
    method getKey (line 86) | @Override
    method setPreviousNode (line 91) | @Override
    method setState (line 96) | @Override
    method setAction (line 101) | @Override
    method setDoUpdate (line 106) | @Override
    method isConsistent (line 115) | public boolean isConsistent(){ return v.compareTo(g) > 0; }
    method getEstimation (line 117) | @Override
    method getScore (line 122) | @Override
    method getCost (line 127) | @Override
    method previousNode (line 138) | @SuppressWarnings("unchecked") //suppress warnings to return an ADStar...
    method compareTo (line 151) | @Override

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/impl/UnweightedNode.java
  class UnweightedNode (line 32) | public class UnweightedNode<A,S> extends AbstractNode<A,S,UnweightedNode...
    method UnweightedNode (line 41) | public UnweightedNode(UnweightedNode<A, S> previousNode, S state, A ac...
    method UnweightedNode (line 52) | public UnweightedNode(UnweightedNode<A, S> previousNode, Transition<A,...
    method newNodeWithoutAction (line 65) | public static <S> UnweightedNode<Void,S> newNodeWithoutAction(Unweight...

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/impl/WeightedNode.java
  class WeightedNode (line 32) | public class WeightedNode<A,S,C extends Comparable<C>>
    method WeightedNode (line 50) | public WeightedNode(WeightedNode<A, S, C> previousNode, S state, A act...
    method getScore (line 57) | @Override
    method getEstimation (line 62) | @Override
    method getCost (line 67) | @Override
    method compareTo (line 72) | @Override
    method toString (line 77) | @Override

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/problem/ProblemBuilder.java
  class ProblemBuilder (line 31) | public final class ProblemBuilder {
    method ProblemBuilder (line 33) | private ProblemBuilder(){
    class Wizard (line 40) | public static final class Wizard {
      method Wizard (line 41) | private Wizard(){}
      class ActionState (line 46) | public static final class ActionState<S> {
        method ActionState (line 50) | public ActionState(S initialState) {
        method ActionState (line 55) | public ActionState(S initialState, S finalState) {
        method defineProblemWithExplicitActions (line 71) | public WithAction defineProblemWithExplicitActions(){
        method defineProblemWithoutActions (line 81) | public WithoutAction defineProblemWithoutActions(){
        class WithoutAction (line 88) | public final class WithoutAction {
          method WithoutAction (line 89) | private WithoutAction(){}
          method useTransitionFunction (line 109) | public Uninformed<Void> useTransitionFunction(TransitionFunction...
        class WithAction (line 117) | public final class WithAction {
          method WithAction (line 118) | private WithAction(){}
          method useActionFunction (line 125) | public <A> Action<A> useActionFunction(ActionFunction<A, S> acti...
          class Action (line 132) | public final class Action<A> {
            method Action (line 135) | public Action(ActionFunction<A, S> af) {
            method useTransitionFunction (line 146) | public Uninformed<A> useTransitionFunction(ActionStateTransiti...
          method useTransitionFunction (line 159) | public <A> Uninformed<A> useTransitionFunction(TransitionFunctio...
        class Uninformed (line 170) | public final class Uninformed<A> {
          method Uninformed (line 173) | private Uninformed(TransitionFunction<A, S> tf){
          method build (line 177) | public SearchProblem<A, S, UnweightedNode<A, S>> build(){
          method useCostFunction (line 195) | public Informed<Double> useCostFunction(CostFunction<A, S, Doubl...
          method useGenericCostFunction (line 200) | public <C extends Comparable<C>> Informed<C> useGenericCostFunct...
          class Informed (line 207) | public final class Informed<C extends Comparable<C>> {
            method Informed (line 211) | public Informed(CostFunction<A, S, C> cf, BinaryOperation<C> c...
            method build (line 216) | public SearchProblem<A, S, WeightedNode<A, S, C>> build(){
            method useHeuristicFunction (line 234) | public Heuristic useHeuristicFunction(HeuristicFunction<S, C> ...
            class Heuristic (line 241) | public final class Heuristic {
              method Heuristic (line 244) | public Heuristic(HeuristicFunction<S, C> hf) {
              method build (line 248) | public SearchProblem<A, S, WeightedNode<A, S, C>> build(){
      method initialState (line 262) | public <S> ActionState<S> initialState(S initialState){
      method initialState (line 266) | public <S> ActionState<S> initialState(S initialState, S finalState){
    method create (line 291) | public static Wizard create(){

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/problem/SearchComponents.java
  class SearchComponents (line 15) | public class SearchComponents<A, S, C extends Comparable<C>> {
    method SearchComponents (line 29) | public SearchComponents(S begin, S goal, CostFunction<A, S, C> cf, Heu...
    method SearchComponents (line 41) | public SearchComponents(S begin, S goal, CostFunction<A, S, C> cf, Heu...
    method SearchComponents (line 46) | public SearchComponents(S begin, S goal, CostFunction<A, S, C> cf, Heu...
    method costFunction (line 51) | public CostFunction<A, S, C> costFunction() {
    method heuristicFunction (line 55) | public HeuristicFunction<S, C> heuristicFunction() {
    method successorFunction (line 59) | public TransitionFunction<A, S> successorFunction() {
    method predecessorFunction (line 63) | public TransitionFunction<A, S> predecessorFunction() {
    method costAlgebra (line 67) | public BinaryOperation<C> costAlgebra() {
    method scaleAlgebra (line 71) | public ScalarOperation<C> scaleAlgebra() {
    method getBegin (line 75) | public S getBegin() {
    method getGoal (line 79) | public S getGoal() {

FILE: hipster-core/src/main/java/es/usc/citius/hipster/model/problem/SearchProblem.java
  class SearchProblem (line 13) | public class SearchProblem<A,S,N extends Node<A,S,N>> {
    method SearchProblem (line 18) | public SearchProblem(N initialNode, NodeExpander<A, S, N> expander) {
    method SearchProblem (line 24) | public SearchProblem(N initialNode, N finalNode, NodeExpander<A, S, N>...
    method getInitialNode (line 30) | public N getInitialNode() {
    method getExpander (line 34) | public NodeExpander<A, S, N> getExpander() {
    method getFinalNode (line 38) | public N getFinalNode() {
    method setFinalNode (line 42) | public void setFinalNode(N finalNode) {

FILE: hipster-core/src/main/java/es/usc/citius/hipster/util/F.java
  class F (line 17) | public final class F {
    method F (line 19) | private F() {}
    method map (line 21) | public static <T,E> Iterable<E> map(final Iterable<T> it, final Functi...
    method map (line 30) | public static <T,E> Iterator<E> map(final Iterator<T> it, final Functi...
    method filter (line 42) | public static <T> Iterable<T> filter(final Iterable<T> it, final Funct...
    method filter (line 51) | public static <T> Iterator<T> filter(final Iterator<T> it, final Funct...
    method flatMap (line 66) | public static <E,T> Iterable<T> flatMap(final Iterable<E> it, final Fu...
    method flatMap (line 80) | public static <E,T> Iterator<T> flatMap(final Iterator<E> it, final Fu...

FILE: hipster-core/src/main/java/es/usc/citius/hipster/util/Function.java
  type Function (line 8) | public interface Function<E, V> {
    method apply (line 10) | public V apply(E input);

FILE: hipster-core/src/main/java/es/usc/citius/hipster/util/Iterators.java
  class Iterators (line 7) | public final class Iterators {
    class AbstractIterator (line 9) | public static abstract class AbstractIterator<E> implements Iterator<E> {
      method AbstractIterator (line 12) | protected AbstractIterator(){}
      method computeNext (line 14) | protected abstract E computeNext();
      method hasNext (line 16) | @Override
      method next (line 24) | @Override
      method remove (line 38) | @Override
    method empty (line 44) | public static <E> Iterator<E> empty() {

FILE: hipster-core/src/main/java/es/usc/citius/hipster/util/Predicate.java
  type Predicate (line 11) | public interface Predicate<T extends Object> {
    method apply (line 13) | public boolean apply(T input);

FILE: hipster-core/src/main/java/es/usc/citius/hipster/util/examples/RomanianProblem.java
  class RomanianProblem (line 21) | public class RomanianProblem {
    type City (line 26) | public enum City{
    method graph (line 93) | public static HipsterGraph<City, Double> graph(){
    method heuristics (line 101) | public static Map<City, Double> heuristics(){
    method heuristicFunction (line 110) | public static HeuristicFunction<City, Double> heuristicFunction(){

FILE: hipster-core/src/main/java/es/usc/citius/hipster/util/examples/maze/Maze2D.java
  class Maze2D (line 70) | public class Maze2D {
    type Symbol (line 82) | public static enum Symbol {
      method Symbol (line 90) | Symbol(char symbol) {
      method value (line 94) | public char value() {
      method parse (line 98) | public static Symbol parse(char c) {
    method Maze2D (line 114) | public Maze2D(char maze[][]) {
    method charToPoint (line 122) | private Point charToPoint(char c){
    method Maze2D (line 136) | public Maze2D(String[] maze2D) throws IllegalFormatException {
    method findMaxRowLength (line 180) | private int findMaxRowLength(String maze[]){
    method findMaxRowLength (line 194) | private int findMaxRowLength(char maze[][]){
    method read (line 209) | public static Maze2D read(File file) throws IOException {
    method isFree (line 226) | public boolean isFree(Point p) {
    method getMazePoints (line 235) | public List<Point> getMazePoints() {
    method updateLocation (line 251) | public void updateLocation(Point p, Symbol symbol) {
    method updateRectangle (line 263) | public void updateRectangle(Point a, Point b, Symbol symbol) {
    method putObstacle (line 279) | public void putObstacle(Point p) {
    method removeObstacle (line 287) | public void removeObstacle(Point p) {
    method putObstacleRectangle (line 296) | public void putObstacleRectangle(Point a, Point b) {
    method removeObstacleRectangle (line 305) | public void removeObstacleRectangle(Point a, Point b) {
    method getReplacedMazeString (line 315) | public String getReplacedMazeString(List<Map<Point, Character>> replac...
    method getStringMazeFilled (line 341) | public String getStringMazeFilled(Collection<Point> points, char symbo...
    method replaceChar (line 349) | private static String replaceChar(String line, int position, char c) {
    method validLocation (line 360) | public boolean validLocation(Point loc) {
    method pointInBounds (line 373) | public boolean pointInBounds(Point loc) {
    method validLocationsFrom (line 382) | public Collection<Point> validLocationsFrom(Point loc) {
    method getMazeCharArray (line 401) | public char[][] getMazeCharArray() {
    method toStringArray (line 405) | public String[] toStringArray() {
    method toString (line 414) | @Override
    method diff (line 430) | public Set<Point> diff(Maze2D to) {
    method getMaze (line 448) | public char[][] getMaze() {
    method getInitialLoc (line 456) | public Point getInitialLoc() {
    method getGoalLoc (line 464) | public Point getGoalLoc() {
    method empty (line 473) | public static Maze2D empty(int size) {

FILE: hipster-core/src/main/java/es/usc/citius/hipster/util/examples/maze/MazeSearch.java
  class MazeSearch (line 34) | public final class MazeSearch {
    method MazeSearch (line 37) | private MazeSearch() {
    class Result (line 44) | public static final class Result {
      method Result (line 50) | public Result(List<Point> path, Double cost) {
      method getCost (line 55) | public Double getCost() {
      method getPath (line 59) | public List<Point> getPath() {
      method hashCode (line 63) | @Override
      method equals (line 71) | @Override
    method printSearch (line 94) | public static void printSearch(Iterator<? extends Node<?,Point,?>> it,...
    method clearOutput (line 119) | public static void clearOutput(int newlines) {
    method getMazeStringSolution (line 134) | public static String getMazeStringSolution(Maze2D maze, Collection<Poi...

FILE: hipster-core/src/main/java/es/usc/citius/hipster/util/examples/maze/Mazes.java
  class Mazes (line 10) | public final class Mazes {
    method Mazes (line 12) | private Mazes(){
    type TestMaze (line 133) | public enum TestMaze {
      method TestMaze (line 144) | TestMaze(Maze2D maze, double minimalPathCost){
      method getMinimalPathCost (line 149) | public double getMinimalPathCost() {
      method getMaze (line 153) | public Maze2D getMaze() {

FILE: hipster-core/src/main/java/es/usc/citius/lab/hipster/collections/FibonacciHeap.java
  class FibonacciHeap (line 82) | public final class FibonacciHeap<T> {
    class Entry (line 90) | public static final class Entry<T> {
      method getValue (line 109) | public T getValue() {
      method setValue (line 118) | public void setValue(T value) {
      method getPriority (line 127) | public double getPriority() {
      method Entry (line 138) | private Entry(T elem, double priority) {
    method enqueue (line 160) | public Entry<T> enqueue(T value, double priority) {
    method min (line 186) | public Entry<T> min() {
    method isEmpty (line 197) | public boolean isEmpty() {
    method size (line 206) | public int size() {
    method merge (line 222) | public static <T> FibonacciHeap<T> merge(FibonacciHeap<T> one, Fibonac...
    method dequeueMin (line 251) | public Entry<T> dequeueMin() {
    method decreaseKey (line 405) | public void decreaseKey(Entry<T> entry, double newPriority) {
    method delete (line 422) | public void delete(Entry<T> entry) {
    method checkPriority (line 439) | private void checkPriority(double priority) {
    method mergeLists (line 460) | private static <T> Entry<T> mergeLists(Entry<T> one, Entry<T> two) {
    method decreaseKeyUnchecked (line 520) | private void decreaseKeyUnchecked(Entry<T> entry, double priority) {
    method cutNode (line 546) | private void cutNode(Entry<T> entry) {

FILE: hipster-core/src/main/java/es/usc/citius/lab/hipster/collections/HashQueue.java
  class HashQueue (line 13) | public class HashQueue<S> extends AbstractQueue<S> {
    method offer (line 18) | @Override
    method poll (line 27) | @Override
    method peek (line 37) | @Override
    method iterator (line 42) | @Override
    method size (line 47) | @Override
    method contains (line 52) | @Override

FILE: hipster-core/src/main/java/es/usc/citius/lab/hipster/collections/adapter/HeuristicNodePriorityEvaluator.java
  class HeuristicNodePriorityEvaluator (line 33) | public class HeuristicNodePriorityEvaluator<A, S, C extends Comparable<C...
    method getPriority (line 34) | @Override

FILE: hipster-core/src/main/java/es/usc/citius/lab/hipster/collections/adapter/PriorityEvaluator.java
  type PriorityEvaluator (line 30) | public interface PriorityEvaluator<N> {
    method getPriority (line 38) | double getPriority(N n);

FILE: hipster-core/src/main/java/es/usc/citius/lab/hipster/collections/adapter/PriorityFibonacciQueue.java
  class PriorityFibonacciQueue (line 32) | public class PriorityFibonacciQueue<N> extends AbstractQueue<N> {
    method PriorityFibonacciQueue (line 36) | public PriorityFibonacciQueue(PriorityEvaluator<N> evaluator) {
    method iterator (line 40) | @Override
    method size (line 60) | @Override
    method offer (line 65) | @Override
    method poll (line 71) | @Override
    method peek (line 76) | @Override

FILE: hipster-core/src/test/java/es/usc/citius/hipster/algorithm/problem/romanian/ADStarRomaniaProblemOptimalSearchTest.java
  class ADStarRomaniaProblemOptimalSearchTest (line 20) | public class ADStarRomaniaProblemOptimalSearchTest extends RomaniaProble...
    method createAlgorithm (line 22) | @Override
    method iterativeSearch (line 36) | @Override

FILE: hipster-core/src/test/java/es/usc/citius/hipster/algorithm/problem/romanian/AStarRomaniaProblemOptimalSearchTest.java
  class AStarRomaniaProblemOptimalSearchTest (line 20) | public class AStarRomaniaProblemOptimalSearchTest extends RomaniaProblem...
    method createAlgorithm (line 22) | @Override
    method iterativeSearch (line 36) | @Override

FILE: hipster-core/src/test/java/es/usc/citius/hipster/algorithm/problem/romanian/BellmanFordRomaniaProblemOptimalSearchTest.java
  class BellmanFordRomaniaProblemOptimalSearchTest (line 20) | public class BellmanFordRomaniaProblemOptimalSearchTest extends RomaniaP...
    method createAlgorithm (line 22) | @Override
    method iterativeSearch (line 34) | @Override

FILE: hipster-core/src/test/java/es/usc/citius/hipster/algorithm/problem/romanian/DijkstraRomaniaProblemOptimalSearchTest.java
  class DijkstraRomaniaProblemOptimalSearchTest (line 22) | public class DijkstraRomaniaProblemOptimalSearchTest extends RomaniaProb...
    method createAlgorithm (line 24) | @Override
    method iterativeSearch (line 36) | @Override

FILE: hipster-core/src/test/java/es/usc/citius/hipster/algorithm/problem/romanian/IDAStarRomaniaProblemOptimalSearchTest.java
  class IDAStarRomaniaProblemOptimalSearchTest (line 20) | public class IDAStarRomaniaProblemOptimalSearchTest extends RomaniaProbl...
    method createAlgorithm (line 22) | @Override
    method iterativeSearch (line 36) | @Override

FILE: hipster-core/src/test/java/es/usc/citius/hipster/algorithm/problem/romanian/RomaniaProblemOptimalHeuristicSearchTest.java
  class RomaniaProblemOptimalHeuristicSearchTest (line 15) | public abstract class RomaniaProblemOptimalHeuristicSearchTest extends R...
    method RomaniaProblemOptimalHeuristicSearchTest (line 19) | public RomaniaProblemOptimalHeuristicSearchTest(){
    method scoresFromAradToBucharest (line 41) | @Test

FILE: hipster-core/src/test/java/es/usc/citius/hipster/algorithm/problem/romanian/RomaniaProblemOptimalSearchTest.java
  class RomaniaProblemOptimalSearchTest (line 30) | public abstract class RomaniaProblemOptimalSearchTest {
    method RomaniaProblemOptimalSearchTest (line 40) | public RomaniaProblemOptimalSearchTest(){
    method optimalPathFromAradToBucharest (line 76) | @Test
    method optimalPathFromAradToBucharestSearchMethod (line 94) | @Test
    method costsFromAradToBucharest (line 112) | @Test
    method doSearch (line 132) | @Before
    method iterativeSearch (line 146) | public abstract List<? extends Node<Void, RomanianProblem.City, ?>> it...
    method createAlgorithm (line 153) | public abstract Algorithm<Void, RomanianProblem.City, ? extends Node<V...

FILE: hipster-core/src/test/java/es/usc/citius/hipster/graph/HashBasedHipsterDirectedGraphTest.java
  class HashBasedHipsterDirectedGraphTest (line 12) | public class HashBasedHipsterDirectedGraphTest {
    method setUp (line 17) | @Before
    method createStarGraph (line 22) | protected HashBasedHipsterDirectedGraph createStarGraph(int vertices){
    method testOutgoingEdgesOf (line 33) | @Test
    method testIncomingEdgesOf (line 41) | @Test
    method testEdges (line 49) | @Test

FILE: hipster-core/src/test/java/es/usc/citius/hipster/graph/HashBasedHipsterGraphTest.java
  class HashBasedHipsterGraphTest (line 12) | public class HashBasedHipsterGraphTest {
    method createStarGraph (line 16) | protected HashBasedHipsterGraph createStarGraph(int vertices){
    method setUp (line 27) | @Before
    method testGraphEdges (line 32) | private void testGraphEdges(){
    method testEdges (line 44) | @Test
    method testEdgesWithDisconnectedVertices (line 49) | @Test
    method testAdd (line 56) | @Test
    method testRemove (line 64) | @Test
    method testRemoveAndCheckEdges (line 70) | @Test
    method testConnect (line 83) | @Test
    method testVertices (line 93) | @Test
    method testEdgesOf (line 99) | @Test

FILE: hipster-core/src/test/java/es/usc/citius/hipster/graph/UndirectedEdgeTest.java
  class UndirectedEdgeTest (line 7) | public class UndirectedEdgeTest {
    method testEqualsWithUndirectedEdgeSwapped (line 9) | @Test
    method testEqualsWithUndirectedEdge (line 16) | @Test
    method testNotEqualsWithUndirectedEdge (line 23) | @Test

FILE: hipster-core/src/test/java/es/usc/citius/hipster/util/graph/GraphBuilderTest.java
  class GraphBuilderTest (line 33) | public class GraphBuilderTest {
    method setUp (line 37) | @BeforeClass
    method testVertices (line 61) | @Test
    method testEdges (line 68) | @Test
    method testIncomingEdges (line 90) | @Test
    method testOutgoingEdges (line 109) | @Test
    method testEdgeSetter (line 128) | @Test

FILE: hipster-core/src/test/java/es/usc/citius/hipster/util/graph/RomanianProblemGraph.java
  class RomanianProblemGraph (line 33) | public class RomanianProblemGraph {
    method setUp (line 36) | @Before
    method testAradRoads (line 41) | @Test

FILE: hipster-core/src/test/java/es/usc/citius/lab/hipster/algorithm/BellmanFordTest.java
  class BellmanFordTest (line 37) | public class BellmanFordTest {
    method negativeCycleTest (line 39) | @Test(expected = NegativeCycleException.class)
    method negativeWeightedGraphTest (line 54) | @Test
    method completeRandomGraph (line 82) | public static HashBasedHipsterGraph<Integer, Integer> completeRandomGr...

FILE: hipster-core/src/test/java/es/usc/citius/lab/hipster/algorithm/DepthFirstSearchTest.java
  class DepthFirstSearchTest (line 34) | public class DepthFirstSearchTest {
    method testTree (line 36) | @Test
    method testGraphWithoutCycles (line 62) | @Test
    method testGraph (line 79) | @Test
    method verify (line 97) | private void verify(Iterator<UnweightedNode<String, String>> iterator,...

FILE: hipster-core/src/test/java/es/usc/citius/lab/hipster/algorithm/DepthLimitedSearchTest.java
  class DepthLimitedSearchTest (line 35) | public class DepthLimitedSearchTest {
    method testTreeStructureNotFound (line 36) | @Test
    method testTreeStructureFound (line 64) | @Test
    method testGraphFound (line 118) | @Test

FILE: hipster-core/src/test/java/es/usc/citius/lab/hipster/algorithm/MultiobjectiveShortestPathTest.java
  class MultiobjectiveShortestPathTest (line 30) | public class MultiobjectiveShortestPathTest {
    class Cost (line 32) | public static class Cost implements Comparable<Cost> {
      method Cost (line 36) | public Cost(double c1, double c2) {
      method toString (line 41) | @Override
      method compareTo (line 49) | @Override
      method equals (line 61) | @Override
      method hashCode (line 74) | @Override
    method test (line 85) | @Test

FILE: hipster-core/src/test/java/es/usc/citius/lab/hipster/collection/HashQueueTest.java
  class HashQueueTest (line 28) | public class HashQueueTest {
    method testOffer (line 29) | @Test
    method testPoll (line 36) | @Test
    method testPeek (line 44) | @Test
    method testIterator (line 52) | @Test
    method testContains (line 68) | @Test

FILE: hipster-core/src/test/java/es/usc/citius/lab/hipster/maze/Maze2DTest.java
  class Maze2DTest (line 34) | public class Maze2DTest {
    method testDiff (line 99) | @Ignore("To be fixed")
    method testPoints (line 113) | @Test
    method testObstacles (line 129) | @Ignore("To be fixed")
    method testPointInBounds (line 141) | @Test
    method testCharToPoint (line 158) | @Test

FILE: hipster-examples/src/main/java/es/usc/citius/hipster/examples/ASCIIMazeVisualizer.java
  class ASCIIMazeVisualizer (line 35) | public class ASCIIMazeVisualizer {
    method $$$setupUI$$$ (line 74) | private void $$$setupUI$$$() {
    method $$$getRootComponent$$$ (line 154) | public JComponent $$$getRootComponent$$$() {
    type State (line 158) | private enum State {STOPPED, STARTED, PAUSED}
    method main (line 172) | public static void main(String[] args) {
    method ASCIIMazeVisualizer (line 187) | public ASCIIMazeVisualizer(final JFrame frame) {
    method continueExecution (line 259) | private void continueExecution() {
    method executeSearchStep (line 266) | private synchronized Node<?, Point, ?> executeSearchStep() {
    method start (line 284) | private void start() {
    method stop (line 301) | private void stop() {
    method pause (line 306) | private void pause() {
    method updateVisualizer (line 311) | private synchronized void updateVisualizer(final Node<?, Point, ?> nod...
    class ExecutionHandler (line 337) | private class ExecutionHandler implements ActionListener, Runnable {
      method ExecutionHandler (line 339) | private ExecutionHandler() {
      method actionPerformed (line 342) | @Override
      method run (line 349) | @Override
    method createAlgorithm (line 366) | private Iterator<? extends Node<?, Point, ?>> createAlgorithm(Maze2D m...
    method loadSelectedMaze (line 394) | private void loadSelectedMaze() {
    method getMazeStringSolution (line 414) | private String getMazeStringSolution(Maze2D maze, Collection<Point> ex...
    method buildProblem (line 429) | private SearchProblem<Void, Point, WeightedNode<Void, Point, Double>> ...

FILE: hipster-examples/src/main/java/es/usc/citius/hipster/examples/BlueprintsGraphMultiobjectiveSearch.java
  class BlueprintsGraphMultiobjectiveSearch (line 31) | public class BlueprintsGraphMultiobjectiveSearch {
    method main (line 33) | public static void main(String[] args) throws IOException {
    method buildGraph (line 98) | private static Graph buildGraph() {
    class Cost (line 151) | static class Cost implements Comparable<Cost> {
      method Cost (line 161) | public Cost(double c1, double c2) {
      method toString (line 166) | @Override
      method compareTo (line 182) | @Override
      method equals (line 199) | @Override
      method hashCode (line 212) | @Override

FILE: hipster-examples/src/main/java/es/usc/citius/hipster/examples/DirectedGraphSearchExample.java
  class DirectedGraphSearchExample (line 22) | public class DirectedGraphSearchExample {
    method main (line 24) | public static void main(String[] args){

FILE: hipster-examples/src/main/java/es/usc/citius/hipster/examples/EightPuzzleProblemExample.java
  class EightPuzzleProblemExample (line 57) | public class EightPuzzleProblemExample {
    method main (line 59) | public static void main(String[] args){

FILE: hipster-examples/src/main/java/es/usc/citius/hipster/examples/EightQueensProblemExample.java
  class EightQueensProblemExample (line 61) | public class EightQueensProblemExample {
    method main (line 63) | public static void main(String[] args) {

FILE: hipster-examples/src/main/java/es/usc/citius/hipster/examples/EightQueensProblemExampleWithAnnealingSearch.java
  class EightQueensProblemExampleWithAnnealingSearch (line 51) | public class EightQueensProblemExampleWithAnnealingSearch {
    method main (line 53) | public static void main(String[] args) {

FILE: hipster-examples/src/main/java/es/usc/citius/hipster/examples/MazeShortestPathExample.java
  class MazeShortestPathExample (line 48) | public class MazeShortestPathExample {
    method main (line 50) | public static void main(String[] args) throws InterruptedException {

FILE: hipster-examples/src/main/java/es/usc/citius/hipster/examples/RomanianProblemDFSExample.java
  class RomanianProblemDFSExample (line 26) | public class RomanianProblemDFSExample {
    method main (line 28) | public static void main(String[] args) throws InterruptedException {

FILE: hipster-examples/src/main/java/es/usc/citius/hipster/examples/RomanianProblemExample.java
  class RomanianProblemExample (line 31) | public class RomanianProblemExample {
    method main (line 33) | public static void main(String[] args) throws InterruptedException {

FILE: hipster-examples/src/main/java/es/usc/citius/hipster/examples/SimpleEightPuzzleExample.java
  class SimpleEightPuzzleExample (line 57) | public class SimpleEightPuzzleExample {
    type Action (line 59) | enum Action { UP, DOWN, LEFT, RIGHT }
    method main (line 61) | public static void main(String[] args){
    method applyActionToState (line 157) | private static List<Integer> applyActionToState(Action action, List<In...
    method validMovementsFor (line 196) | private static Iterable<Action> validMovementsFor(List<Integer> state) {

FILE: hipster-examples/src/main/java/es/usc/citius/hipster/examples/UndirectedGraphSearchExample.java
  class UndirectedGraphSearchExample (line 31) | public class UndirectedGraphSearchExample {
    method main (line 33) | public static void main(String args[]) {

FILE: hipster-examples/src/main/java/es/usc/citius/hipster/examples/problem/NPuzzle.java
  class NPuzzle (line 29) | public final class NPuzzle {
    method NPuzzle (line 31) | private NPuzzle(){}
    method getPrettyPath (line 40) | public static String getPrettyPath(List<Puzzle> path, int size) {
    type PuzzleMove (line 69) | public enum PuzzleMove {
    class Puzzle (line 85) | public static final class Puzzle {
      method Puzzle (line 96) | public Puzzle(int[][] board) {
      method Puzzle (line 112) | public Puzzle(int[] plainBoard) {
      method matrixBoard (line 116) | int[][] matrixBoard(int[] plainBoard) {
      method copyBoard (line 129) | public int[][] copyBoard() {
      method getMatrixBoard (line 133) | public int[][] getMatrixBoard() {
      method isSquare (line 140) | boolean isSquare(int[][] board) {
      method getTile (line 150) | public Point getTile(int number) {
      method getPreviousBoard (line 163) | public Puzzle getPreviousBoard() {
      method setPreviousBoard (line 167) | public void setPreviousBoard(Puzzle previousBoard) {
      method toString (line 171) | @Override
      method equals (line 180) | @Override
      method hashCode (line 192) | @Override

FILE: hipster-examples/src/main/java/es/usc/citius/hipster/examples/problem/NQueens.java
  class NQueens (line 32) | public class NQueens {
    method NQueens (line 49) | public NQueens(int size) {
    method NQueens (line 58) | public NQueens(int queens[]) {
    method toString (line 62) | @Override
    method isAttacked (line 77) | public boolean isAttacked(int row, int column) {
    method isAttacked (line 91) | public boolean isAttacked(int row) {
    method attackedQueens (line 95) | public int attackedQueens() {
    method equals (line 108) | @Override
    method hashCode (line 120) | @Override
    method getQueens (line 125) | public int[] getQueens() {

FILE: hipster-examples/src/test/java/es/usc/citius/lab/hipster/examples/NQueensTest.java
  class NQueensTest (line 28) | public class NQueensTest {
    method test8QueenZeroAttacked (line 30) | @Test
    method test8QueenSameColumnDiagonalAttacked (line 36) | @Test
    method test8QueenSameColumnAttacked (line 42) | @Test
    method test8QueenEqualsHashCode (line 48) | @Test

FILE: hipster-extensions/src/main/java/es/usc/citius/hipster/extensions/graph/HashTableHipsterDirectedGraph.java
  class HashTableHipsterDirectedGraph (line 28) | public class HashTableHipsterDirectedGraph<V,E> extends HashTableHipster...
    method connect (line 30) | @Override
    method outgoingEdgesOf (line 40) | @Override
    method incomingEdgesOf (line 45) | @Override
    method create (line 50) | public static <V,E> HashTableHipsterDirectedGraph<V, E> create() {

FILE: hipster-extensions/src/main/java/es/usc/citius/hipster/extensions/graph/HashTableHipsterGraph.java
  class HashTableHipsterGraph (line 33) | public class HashTableHipsterGraph<V,E> implements HipsterGraph<V,E> {
    method add (line 38) | public void add(V v){
    method greaterThan (line 44) | private <T> boolean greaterThan(int size, Iterable<T> iterable){
    method remove (line 55) | public void remove(V v){
    method remove (line 75) | public void remove(V v, GraphEdge<V,E> edge){
    method connect (line 82) | public GraphEdge<V,E> connect(V v1, V v2, E value){
    method edges (line 92) | @Override
    method vertices (line 97) | @Override
    method edgesOf (line 102) | @Override
    method create (line 107) | public static <V,E> HashTableHipsterGraph<V, E> create() {

FILE: hipster-extensions/src/test/java/es/usc/citius/hipster/extensions/graph/HashTableHipsterDirectedGraphTest.java
  class HashTableHipsterDirectedGraphTest (line 30) | public class HashTableHipsterDirectedGraphTest extends HashTableHipsterG...
    method setUp (line 33) | @Before
    method testConnect (line 47) | @Test
    method testOutgoingEdgesOf (line 53) | @Test
    method testIncomingEdgesOf (line 61) | @Test
    method testEdges (line 69) | @Test
    method testEdgesOf (line 83) | @Test

FILE: hipster-extensions/src/test/java/es/usc/citius/hipster/extensions/graph/HashTableHipsterGraphTest.java
  class HashTableHipsterGraphTest (line 33) | public class HashTableHipsterGraphTest {
    method setUp (line 36) | @Before
    method testAdd (line 48) | @Test
    method testRemove (line 54) | @Test
    method testRemoveEdge (line 60) | @Test
    method testConnect (line 65) | @Test
    method testEdges (line 72) | @Test
    method testVertices (line 85) | @Test
    method testEdgesOf (line 91) | @Test
    method testDisconnectedVertices (line 100) | @Test

FILE: hipster-third-party-graphs/src/main/java/es/usc/citius/hipster/thirdparty/graphs/blueprints/BlueprintsHipsterDirectedGraphAdapter.java
  class BlueprintsHipsterDirectedGraphAdapter (line 30) | public class BlueprintsHipsterDirectedGraphAdapter extends BlueprintsHip...
    method BlueprintsHipsterDirectedGraphAdapter (line 32) | public BlueprintsHipsterDirectedGraphAdapter(Graph graph) {
    method outgoingEdgesOf (line 36) | @Override
    method incomingEdgesOf (line 41) | @Override

FILE: hipster-third-party-graphs/src/main/java/es/usc/citius/hipster/thirdparty/graphs/blueprints/BlueprintsHipsterGraphAdapter.java
  class BlueprintsHipsterGraphAdapter (line 35) | public class BlueprintsHipsterGraphAdapter implements HipsterGraph<Verte...
    method BlueprintsHipsterGraphAdapter (line 38) | public BlueprintsHipsterGraphAdapter(Graph graph) {
    method edges (line 42) | @Override
    method vertices (line 47) | @Override
    method edgesOf (line 52) | @Override
    method convertEdges (line 57) | protected static Iterable<GraphEdge<Vertex,Edge>> convertEdges(final I...

FILE: hipster-third-party-graphs/src/main/java/es/usc/citius/hipster/thirdparty/graphs/jung/JUNGHipsterDirectedGraphAdapter.java
  class JUNGHipsterDirectedGraphAdapter (line 33) | public class JUNGHipsterDirectedGraphAdapter<V,E> extends JUNGHipsterGra...
    method JUNGHipsterDirectedGraphAdapter (line 35) | public JUNGHipsterDirectedGraphAdapter(Graph<V, E> graph) {
    method outgoingEdgesOf (line 39) | @Override
    method incomingEdgesOf (line 53) | @Override

FILE: hipster-third-party-graphs/src/main/java/es/usc/citius/hipster/thirdparty/graphs/jung/JUNGHipsterGraphAdapter.java
  class JUNGHipsterGraphAdapter (line 37) | public class JUNGHipsterGraphAdapter<V,E> implements HipsterGraph<V,E> {
    method JUNGHipsterGraphAdapter (line 40) | public JUNGHipsterGraphAdapter(Graph<V, E> graph) {
    method adapt (line 44) | protected Iterable<GraphEdge<V,E>> adapt(final Iterable<E> iterable){
    method edges (line 60) | @Override
    method vertices (line 69) | @Override
    method edgesOf (line 74) | @Override

FILE: hipster-third-party-graphs/src/test/java/es/usc/citius/hipster/thirdparty/graphs/JUNGHipsterGraphAdapterTest.java
  class JUNGHipsterGraphAdapterTest (line 43) | public class JUNGHipsterGraphAdapterTest {
    method setUp (line 50) | @BeforeClass
    method testUniformShortestPathSearch (line 68) | @Test
    method testWeightedShortestPathSearch (line 85) | @Test
Condensed preview — 162 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (652K chars).
[
  {
    "path": ".config/deploy-artifacts.sh",
    "chars": 393,
    "preview": "#!/bin/bash\n\necho \"Auto-deploying Hipster4j snapshots...\"\necho \"Current branch: $TRAVIS_BRANCH\"\nif [ \"$TRAVIS_PULL_REQUE"
  },
  {
    "path": ".config/maven-settings.xml",
    "chars": 2434,
    "preview": "<!--\n~ Copyright 2014 Centro de Investigación en Tecnoloxías da Información (CITIUS),\n~ University of Santiago de Compos"
  },
  {
    "path": ".config/publish-javadocs.sh",
    "chars": 1962,
    "preview": "#!/bin/bash\n\nif [ \"$TRAVIS_PULL_REQUEST\" != \"false\" ]; then\n  echo \"Skipping Javadoc publication for pull request\"\n  exi"
  },
  {
    "path": ".github/workflows/maven.yml",
    "chars": 665,
    "preview": "# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow executi"
  },
  {
    "path": ".gitignore",
    "chars": 271,
    "preview": "*.class\n\n# Package Files #\n*.jar\n*.war\n*.ear\n*~\n\n.classpath\n.project\n.directory\n.settings/\ntarget/\n\n# Netbeans specific "
  },
  {
    "path": ".gitlab-sync",
    "chars": 1,
    "preview": "\n"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 15851,
    "preview": "# Change Log\n\n## [1.0.1](https://github.com/citiususc/hipster/tree/1.0.1) (2016-05-16)\n[Full Changelog](https://github.c"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 6106,
    "preview": "# Contributing to Hipster4j\r\n\r\nFirst of all, thank you so much for being interested in contributing to Hipster4j!. This "
  },
  {
    "path": "LICENSE",
    "chars": 11359,
    "preview": "                                 Apache License\n                           Version 2.0, January 2004\n                   "
  },
  {
    "path": "README.md",
    "chars": 8184,
    "preview": "![Hipster](src/main/doclava/custom/assets/hipster-template/assets/images/header-logo.png?raw=true)\n\n![CI](https://github"
  },
  {
    "path": "hipster-all/pom.xml",
    "chars": 2815,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de "
  },
  {
    "path": "hipster-all/src/main/java/es/usc/citius/hipster/all/package-info.java",
    "chars": 764,
    "preview": "/*\n * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS), University of Santiago de Compostel"
  },
  {
    "path": "hipster-core/pom.xml",
    "chars": 826,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xmlns:xsi=\"http://www"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/algorithm/ADStarForward.java",
    "chars": 13248,
    "preview": "/*\n* Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS), University of Santiago de Compostela"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/algorithm/AStar.java",
    "chars": 7788,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/algorithm/Algorithm.java",
    "chars": 7439,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/algorithm/BellmanFord.java",
    "chars": 6457,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/algorithm/BreadthFirstSearch.java",
    "chars": 3578,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/algorithm/DepthFirstSearch.java",
    "chars": 6515,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/algorithm/DepthLimitedSearch.java",
    "chars": 4311,
    "preview": "package es.usc.citius.hipster.algorithm;\n\nimport es.usc.citius.hipster.model.Node;\nimport es.usc.citius.hipster.model.fu"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/algorithm/Hipster.java",
    "chars": 11924,
    "preview": "/*\r\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\r\n *\r\n *    Licensed under the"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/algorithm/IDAStar.java",
    "chars": 6291,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/algorithm/MultiobjectiveLS.java",
    "chars": 6723,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/algorithm/NegativeCycleException.java",
    "chars": 261,
    "preview": "package es.usc.citius.hipster.algorithm;\n\n\npublic class NegativeCycleException extends RuntimeException {\n    private st"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/algorithm/localsearch/AnnealingSearch.java",
    "chars": 7132,
    "preview": "package es.usc.citius.hipster.algorithm.localsearch;\r\n\r\nimport java.util.ArrayList;\r\nimport java.util.Iterator;\r\nimport "
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/algorithm/localsearch/HillClimbing.java",
    "chars": 5958,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/algorithm/localsearch/package-info.java",
    "chars": 849,
    "preview": "/*\n * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS), University of Santiago de Compostel"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/algorithm/package-info.java",
    "chars": 940,
    "preview": "/*\n * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS), University of Santiago de Compostel"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/graph/DirectedEdge.java",
    "chars": 1163,
    "preview": "package es.usc.citius.hipster.graph;\n\npublic class DirectedEdge<V,E> implements GraphEdge<V,E> {\n\n    private Pair<V> ve"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/graph/GraphBuilder.java",
    "chars": 4992,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/graph/GraphEdge.java",
    "chars": 1209,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/graph/GraphSearchProblem.java",
    "chars": 11508,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/graph/HashBasedHipsterDirectedGraph.java",
    "chars": 2979,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/graph/HashBasedHipsterGraph.java",
    "chars": 6337,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/graph/HipsterDirectedGraph.java",
    "chars": 1101,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/graph/HipsterGraph.java",
    "chars": 1472,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/graph/HipsterMutableGraph.java",
    "chars": 1436,
    "preview": "package es.usc.citius.hipster.graph;\n\n\nimport java.util.Set;\n\n/**\n * Interface that defines the basic mutable methods to"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/graph/Pair.java",
    "chars": 1192,
    "preview": "package es.usc.citius.hipster.graph;\n\n\npublic class Pair<E> {\n    private E e1, e2;\n\n    public Pair(E e1, E e2) {\n     "
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/graph/UndirectedEdge.java",
    "chars": 1192,
    "preview": "package es.usc.citius.hipster.graph;\n\n\npublic class UndirectedEdge<V,E> implements GraphEdge<V,E> {\n\n    private Unorder"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/graph/UniqueEdge.java",
    "chars": 2290,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/graph/UnorderedPair.java",
    "chars": 1153,
    "preview": "package es.usc.citius.hipster.graph;\n\npublic class UnorderedPair<E> {\n    private E e1, e2;\n\n    public UnorderedPair(E "
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/graph/package-info.java",
    "chars": 832,
    "preview": "/*\n * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS), University of Santiago de Compostel"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/ADStarNode.java",
    "chars": 4921,
    "preview": "package es.usc.citius.hipster.model;\n\nimport es.usc.citius.hipster.model.function.ScalarFunction;\nimport es.usc.citius.h"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/AbstractNode.java",
    "chars": 2718,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/CostNode.java",
    "chars": 1669,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/HeuristicNode.java",
    "chars": 2011,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/Node.java",
    "chars": 2347,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/SimpleTransition.java",
    "chars": 1725,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/Transition.java",
    "chars": 4377,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/function/ActionFunction.java",
    "chars": 1302,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/function/ActionStateTransitionFunction.java",
    "chars": 1448,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/function/BinaryFunction.java",
    "chars": 2128,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/function/CostFunction.java",
    "chars": 1280,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/function/HeuristicFunction.java",
    "chars": 1038,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/function/NodeExpander.java",
    "chars": 1336,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/function/NodeFactory.java",
    "chars": 1128,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/function/ScalarFunction.java",
    "chars": 2114,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/function/TransitionFunction.java",
    "chars": 1513,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/ADStarNodeExpander.java",
    "chars": 12998,
    "preview": "package es.usc.citius.hipster.model.function.impl;\n\nimport es.usc.citius.hipster.model.Transition;\nimport es.usc.citius."
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/ADStarNodeFactory.java",
    "chars": 3049,
    "preview": "/*\n* Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS).\n*\n* Licensed under the Apache Licens"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/ADStarNodeUpdater.java",
    "chars": 3684,
    "preview": "/*\n* Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS).\n*\n* Licensed under the Apache Licens"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/BinaryOperation.java",
    "chars": 3493,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/LazyActionStateTransitionFunction.java",
    "chars": 2605,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/LazyNodeExpander.java",
    "chars": 2897,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/Product.java",
    "chars": 1442,
    "preview": "/*\n * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS), University of Santiago de Compostel"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/ScalarOperation.java",
    "chars": 1589,
    "preview": "package es.usc.citius.hipster.model.function.impl;\n\n\nimport es.usc.citius.hipster.model.function.ScalarFunction;\n\n/**\n *"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/StateTransitionFunction.java",
    "chars": 2254,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/WeightedNodeFactory.java",
    "chars": 4060,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/package-info.java",
    "chars": 866,
    "preview": "/*\n * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS), University of Santiago de Compostel"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/function/package-info.java",
    "chars": 854,
    "preview": "/*\n * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS), University of Santiago de Compostel"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/impl/ADStarNodeImpl.java",
    "chars": 4195,
    "preview": "package es.usc.citius.hipster.model.impl;\n\nimport es.usc.citius.hipster.model.ADStarNode;\nimport es.usc.citius.hipster.m"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/impl/UnweightedNode.java",
    "chars": 2642,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/impl/WeightedNode.java",
    "chars": 2636,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/impl/package-info.java",
    "chars": 827,
    "preview": "/*\n * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS), University of Santiago de Compostel"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/package-info.java",
    "chars": 865,
    "preview": "/*\n * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS), University of Santiago de Compostel"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/problem/ProblemBuilder.java",
    "chars": 13056,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/problem/SearchComponents.java",
    "chars": 2760,
    "preview": "package es.usc.citius.hipster.model.problem;\n\nimport es.usc.citius.hipster.model.function.CostFunction;\nimport es.usc.ci"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/problem/SearchProblem.java",
    "chars": 1382,
    "preview": "package es.usc.citius.hipster.model.problem;\n\nimport es.usc.citius.hipster.model.Node;\nimport es.usc.citius.hipster.mode"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/model/problem/package-info.java",
    "chars": 1526,
    "preview": "/*\n * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS), University of Santiago de Compostel"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/util/F.java",
    "chars": 3325,
    "preview": "package es.usc.citius.hipster.util;\n\n\nimport java.util.Iterator;\n\n\n/**\n * This class contains a very limited set of func"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/util/Function.java",
    "chars": 214,
    "preview": "package es.usc.citius.hipster.util;\n\n/**\n *\n *\n * @author Adrián González Sieira <<a href=\"adrian.gonzalez@usc.es\">adria"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/util/Iterators.java",
    "chars": 1242,
    "preview": "package es.usc.citius.hipster.util;\n\n\nimport java.util.Iterator;\nimport java.util.NoSuchElementException;\n\npublic final "
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/util/Predicate.java",
    "chars": 520,
    "preview": "package es.usc.citius.hipster.util;\n\n/**\n * Definition of predictcate to be used with search iterators implementing the\n"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/util/examples/RomanianProblem.java",
    "chars": 5056,
    "preview": "package es.usc.citius.hipster.util.examples;\n\nimport es.usc.citius.hipster.graph.GraphBuilder;\nimport es.usc.citius.hips"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/util/examples/maze/Maze2D.java",
    "chars": 15791,
    "preview": "/*\n * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS).\n *\n * Licensed under the Apache Lic"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/util/examples/maze/MazeSearch.java",
    "chars": 5882,
    "preview": "/*\n * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS).\n *\n * Licensed under the Apache Lic"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/util/examples/maze/Mazes.java",
    "chars": 5904,
    "preview": "package es.usc.citius.hipster.util.examples.maze;\n\n\n/**\n * Class containing a set of {@link es.usc.citius.hipster.util.e"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/util/examples/maze/package-info.java",
    "chars": 861,
    "preview": "/*\n * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS), University of Santiago de Compostel"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/hipster/util/examples/package-info.java",
    "chars": 813,
    "preview": "/*\n * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS), University of Santiago de Compostel"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/lab/hipster/collections/FibonacciHeap.java",
    "chars": 24049,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/lab/hipster/collections/HashQueue.java",
    "chars": 1220,
    "preview": "package es.usc.citius.lab.hipster.collections;\n\nimport java.util.AbstractQueue;\nimport java.util.Iterator;\nimport java.u"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/lab/hipster/collections/adapter/HeuristicNodePriorityEvaluator.java",
    "chars": 1773,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/lab/hipster/collections/adapter/PriorityEvaluator.java",
    "chars": 1361,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/lab/hipster/collections/adapter/PriorityFibonacciQueue.java",
    "chars": 2208,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/lab/hipster/collections/adapter/package-info.java",
    "chars": 864,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/main/java/es/usc/citius/lab/hipster/collections/package-info.java",
    "chars": 816,
    "preview": "/*\n * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS), University of Santiago de Compostel"
  },
  {
    "path": "hipster-core/src/test/java/es/usc/citius/hipster/algorithm/problem/romanian/ADStarRomaniaProblemOptimalSearchTest.java",
    "chars": 1884,
    "preview": "package es.usc.citius.hipster.algorithm.problem.romanian;\n\nimport es.usc.citius.hipster.algorithm.ADStarForward;\nimport "
  },
  {
    "path": "hipster-core/src/test/java/es/usc/citius/hipster/algorithm/problem/romanian/AStarRomaniaProblemOptimalSearchTest.java",
    "chars": 1799,
    "preview": "package es.usc.citius.hipster.algorithm.problem.romanian;\n\nimport es.usc.citius.hipster.algorithm.AStar;\nimport es.usc.c"
  },
  {
    "path": "hipster-core/src/test/java/es/usc/citius/hipster/algorithm/problem/romanian/BellmanFordRomaniaProblemOptimalSearchTest.java",
    "chars": 2083,
    "preview": "package es.usc.citius.hipster.algorithm.problem.romanian;\n\nimport es.usc.citius.hipster.algorithm.Algorithm;\nimport es.u"
  },
  {
    "path": "hipster-core/src/test/java/es/usc/citius/hipster/algorithm/problem/romanian/DijkstraRomaniaProblemOptimalSearchTest.java",
    "chars": 1756,
    "preview": "package es.usc.citius.hipster.algorithm.problem.romanian;\n\nimport es.usc.citius.hipster.algorithm.AStar;\nimport es.usc.c"
  },
  {
    "path": "hipster-core/src/test/java/es/usc/citius/hipster/algorithm/problem/romanian/IDAStarRomaniaProblemOptimalSearchTest.java",
    "chars": 1869,
    "preview": "package es.usc.citius.hipster.algorithm.problem.romanian;\n\nimport es.usc.citius.hipster.algorithm.Algorithm;\nimport es.u"
  },
  {
    "path": "hipster-core/src/test/java/es/usc/citius/hipster/algorithm/problem/romanian/RomaniaProblemOptimalHeuristicSearchTest.java",
    "chars": 2242,
    "preview": "package es.usc.citius.hipster.algorithm.problem.romanian;\n\nimport es.usc.citius.hipster.model.HeuristicNode;\nimport es.u"
  },
  {
    "path": "hipster-core/src/test/java/es/usc/citius/hipster/algorithm/problem/romanian/RomaniaProblemOptimalSearchTest.java",
    "chars": 7149,
    "preview": "package es.usc.citius.hipster.algorithm.problem.romanian;\n\nimport es.usc.citius.hipster.algorithm.Algorithm;\nimport es.u"
  },
  {
    "path": "hipster-core/src/test/java/es/usc/citius/hipster/graph/HashBasedHipsterDirectedGraphTest.java",
    "chars": 1400,
    "preview": "package es.usc.citius.hipster.graph;\n\nimport com.google.common.collect.Sets;\nimport org.junit.Before;\nimport org.junit.T"
  },
  {
    "path": "hipster-core/src/test/java/es/usc/citius/hipster/graph/HashBasedHipsterGraphTest.java",
    "chars": 2884,
    "preview": "package es.usc.citius.hipster.graph;\n\nimport com.google.common.collect.Sets;\nimport org.junit.Before;\nimport org.junit.T"
  },
  {
    "path": "hipster-core/src/test/java/es/usc/citius/hipster/graph/UndirectedEdgeTest.java",
    "chars": 850,
    "preview": "package es.usc.citius.hipster.graph;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\npublic class Undirected"
  },
  {
    "path": "hipster-core/src/test/java/es/usc/citius/hipster/util/graph/GraphBuilderTest.java",
    "chars": 6190,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/test/java/es/usc/citius/hipster/util/graph/RomanianProblemGraph.java",
    "chars": 1993,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/test/java/es/usc/citius/lab/hipster/algorithm/BellmanFordTest.java",
    "chars": 3711,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/test/java/es/usc/citius/lab/hipster/algorithm/DepthFirstSearchTest.java",
    "chars": 4305,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/test/java/es/usc/citius/lab/hipster/algorithm/DepthLimitedSearchTest.java",
    "chars": 6385,
    "preview": "package es.usc.citius.lab.hipster.algorithm;\n\nimport es.usc.citius.hipster.algorithm.DepthLimitedSearch;\nimport es.usc.c"
  },
  {
    "path": "hipster-core/src/test/java/es/usc/citius/lab/hipster/algorithm/MultiobjectiveShortestPathTest.java",
    "chars": 4849,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-core/src/test/java/es/usc/citius/lab/hipster/collection/HashQueueTest.java",
    "chars": 2657,
    "preview": "/*\n * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS), University of Santiago de Compostel"
  },
  {
    "path": "hipster-core/src/test/java/es/usc/citius/lab/hipster/maze/Maze2DTest.java",
    "chars": 6671,
    "preview": "/*\n * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS).\n *\n * Licensed under the Apache Lic"
  },
  {
    "path": "hipster-examples/pom.xml",
    "chars": 2112,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de "
  },
  {
    "path": "hipster-examples/src/main/java/es/usc/citius/hipster/examples/ASCIIMazeVisualizer.form",
    "chars": 9547,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<form xmlns=\"http://www.intellij.com/uidesigner/form/\" version=\"1\" bind-to-class="
  },
  {
    "path": "hipster-examples/src/main/java/es/usc/citius/hipster/examples/ASCIIMazeVisualizer.java",
    "chars": 20183,
    "preview": "package es.usc.citius.hipster.examples;\n\nimport com.google.common.base.Function;\nimport com.google.common.base.Joiner;\ni"
  },
  {
    "path": "hipster-examples/src/main/java/es/usc/citius/hipster/examples/BlueprintsGraphMultiobjectiveSearch.java",
    "chars": 7864,
    "preview": "package es.usc.citius.hipster.examples;\n\nimport com.tinkerpop.blueprints.Direction;\nimport com.tinkerpop.blueprints.Edge"
  },
  {
    "path": "hipster-examples/src/main/java/es/usc/citius/hipster/examples/DirectedGraphSearchExample.java",
    "chars": 2733,
    "preview": "package es.usc.citius.hipster.examples;\n\nimport es.usc.citius.hipster.algorithm.Hipster;\nimport es.usc.citius.hipster.gr"
  },
  {
    "path": "hipster-examples/src/main/java/es/usc/citius/hipster/examples/EightPuzzleProblemExample.java",
    "chars": 8178,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-examples/src/main/java/es/usc/citius/hipster/examples/EightQueensProblemExample.java",
    "chars": 7272,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-examples/src/main/java/es/usc/citius/hipster/examples/EightQueensProblemExampleWithAnnealingSearch.java",
    "chars": 5648,
    "preview": "/*\r\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\r\n *\r\n *    Licensed under the"
  },
  {
    "path": "hipster-examples/src/main/java/es/usc/citius/hipster/examples/MazeShortestPathExample.java",
    "chars": 9502,
    "preview": "/*\n* Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n*\n*    Licensed under the Apach"
  },
  {
    "path": "hipster-examples/src/main/java/es/usc/citius/hipster/examples/RomanianProblemDFSExample.java",
    "chars": 3858,
    "preview": "package es.usc.citius.hipster.examples;\n\nimport es.usc.citius.hipster.algorithm.Hipster;\nimport es.usc.citius.hipster.gr"
  },
  {
    "path": "hipster-examples/src/main/java/es/usc/citius/hipster/examples/RomanianProblemExample.java",
    "chars": 4435,
    "preview": "package es.usc.citius.hipster.examples;\n\nimport es.usc.citius.hipster.algorithm.Hipster;\nimport es.usc.citius.hipster.gr"
  },
  {
    "path": "hipster-examples/src/main/java/es/usc/citius/hipster/examples/SimpleEightPuzzleExample.java",
    "chars": 10331,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-examples/src/main/java/es/usc/citius/hipster/examples/UndirectedGraphSearchExample.java",
    "chars": 5071,
    "preview": "package es.usc.citius.hipster.examples;\n\nimport es.usc.citius.hipster.algorithm.Hipster;\nimport es.usc.citius.hipster.gr"
  },
  {
    "path": "hipster-examples/src/main/java/es/usc/citius/hipster/examples/package-info.java",
    "chars": 825,
    "preview": "/*\n * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS), University of Santiago de Compostel"
  },
  {
    "path": "hipster-examples/src/main/java/es/usc/citius/hipster/examples/problem/NPuzzle.java",
    "chars": 6583,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-examples/src/main/java/es/usc/citius/hipster/examples/problem/NQueens.java",
    "chars": 3561,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-examples/src/main/java/es/usc/citius/hipster/examples/problem/package-info.java",
    "chars": 798,
    "preview": "/*\n * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS), University of Santiago de Compostel"
  },
  {
    "path": "hipster-examples/src/test/java/es/usc/citius/hipster/search/local/NQueensEHCTest.java",
    "chars": 3602,
    "preview": "///*\n// * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n// *\n// *    Licensed unde"
  },
  {
    "path": "hipster-examples/src/test/java/es/usc/citius/lab/hipster/examples/NQueensTest.java",
    "chars": 1872,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-extensions/pom.xml",
    "chars": 1492,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xmlns:xsi=\"http://www"
  },
  {
    "path": "hipster-extensions/src/main/java/es/usc/citius/hipster/extensions/graph/HashTableHipsterDirectedGraph.java",
    "chars": 2010,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-extensions/src/main/java/es/usc/citius/hipster/extensions/graph/HashTableHipsterGraph.java",
    "chars": 3991,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-extensions/src/test/java/es/usc/citius/hipster/extensions/graph/HashTableHipsterDirectedGraphTest.java",
    "chars": 3763,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-extensions/src/test/java/es/usc/citius/hipster/extensions/graph/HashTableHipsterGraphTest.java",
    "chars": 3838,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-test/pom.xml",
    "chars": 1862,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de "
  },
  {
    "path": "hipster-third-party-graphs/pom.xml",
    "chars": 2368,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de "
  },
  {
    "path": "hipster-third-party-graphs/src/main/java/es/usc/citius/hipster/thirdparty/graphs/blueprints/BlueprintsHipsterDirectedGraphAdapter.java",
    "chars": 1646,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-third-party-graphs/src/main/java/es/usc/citius/hipster/thirdparty/graphs/blueprints/BlueprintsHipsterGraphAdapter.java",
    "chars": 2454,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-third-party-graphs/src/main/java/es/usc/citius/hipster/thirdparty/graphs/blueprints/package-info.java",
    "chars": 912,
    "preview": "/*\n * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS), University of Santiago de Compostel"
  },
  {
    "path": "hipster-third-party-graphs/src/main/java/es/usc/citius/hipster/thirdparty/graphs/jung/JUNGHipsterDirectedGraphAdapter.java",
    "chars": 2302,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-third-party-graphs/src/main/java/es/usc/citius/hipster/thirdparty/graphs/jung/JUNGHipsterGraphAdapter.java",
    "chars": 2972,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "hipster-third-party-graphs/src/main/java/es/usc/citius/hipster/thirdparty/graphs/jung/package-info.java",
    "chars": 884,
    "preview": "/*\n * Copyright 2013 Centro de Investigación en Tecnoloxías da Información (CITIUS), University of Santiago de Compostel"
  },
  {
    "path": "hipster-third-party-graphs/src/test/java/es/usc/citius/hipster/thirdparty/graphs/JUNGHipsterGraphAdapterTest.java",
    "chars": 5160,
    "preview": "/*\n * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.\n *\n *    Licensed under the Ap"
  },
  {
    "path": "pom.xml",
    "chars": 10334,
    "preview": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:sc"
  },
  {
    "path": "src/main/doclava/custom/assets/hipster-template/assets/customizations.css",
    "chars": 3366,
    "preview": "#header {\n    border-bottom: 3px solid #0767a4;\n}\n\n#search_filtered .jd-selected {\n    background-color: #0767a4;\n}\n\n/**"
  },
  {
    "path": "src/main/doclava/custom/assets/hipster-template/assets/customizations.js",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "src/main/doclava/custom/assets/hipster-template/components/api_filter.cs",
    "chars": 893,
    "preview": "<?cs # The default API filter selector that goes in the header ?><?cs\ndef:default_api_filter() ?><?cs\n  if:reference.api"
  },
  {
    "path": "src/main/doclava/custom/assets/hipster-template/components/left_nav.cs",
    "chars": 3533,
    "preview": "<?cs # The default side navigation for the reference docs ?><?cs \ndef:custom_left_nav() ?>\n  <div class=\"g-section g-tpl"
  },
  {
    "path": "src/main/doclava/custom/assets/hipster-template/components/masthead.cs",
    "chars": 415,
    "preview": "<?cs def:custom_masthead() ?>\n<div id=\"header\">\n    <div id=\"headerLeft\">\n    <?cs if:project.name ?>\n      <span id=\"ma"
  },
  {
    "path": "src/main/doclava/custom/assets/hipster-template/components/search_box.cs",
    "chars": 1634,
    "preview": "<?cs # The default search box that goes in the header ?><?cs \ndef:default_search_box() ?>\n  <div id=\"search\" >\n      <di"
  },
  {
    "path": "src/main/doclava/custom/assets/hipster-template/customizations.cs",
    "chars": 486,
    "preview": "<?cs # placeholder for custom clearsilver code. ?>\n<?cs def:custom_masthead() ?>\n<div id=\"header\">\n    <div id=\"headerLe"
  },
  {
    "path": "src/main/doclava/custom/assets/hipster-template/footer.cs",
    "chars": 236,
    "preview": "<div id=\"footer\">\n<!--Generated by <a href=\"http://code.google.com/p/doclava/\">Doclava</a>-->\nCopyrigth &copy Centro de "
  },
  {
    "path": "src/main/javadoc/overview.html",
    "chars": 475,
    "preview": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n<html>\n<head>\n    <title>Hipster - A heuristic search lib"
  },
  {
    "path": "src/main/javadoc/stylesheet.css",
    "chars": 13674,
    "preview": "/* Javadoc style sheet */\n/*\nOverall document style\n*/\nbody {\n    background-color:#ffffff;\n    color:#353833;\n    font-"
  },
  {
    "path": "src/site/markdown/citation.md",
    "chars": 537,
    "preview": "### Citation\n\nThe project was also accepted in the 9th Iberian Conference on Information Systems and Technologies (CISTI"
  },
  {
    "path": "src/site/markdown/index.md",
    "chars": 5050,
    "preview": "<div class=\"jumbotron\">\n    <div class=\"container\">\n        <center>\n            <p><img alt=\"\" src=\"img/hipster-no-text"
  },
  {
    "path": "src/site/resources/css/site.css",
    "chars": 3425,
    "preview": "@import url(\"http://fonts.googleapis.com/css?family=Lobster|Cabin:400,700\");\n\n.color-highlight {\n\tcolor: #225E9B;\n}\n\nbod"
  },
  {
    "path": "src/site/site.xml",
    "chars": 4054,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<!--\n  ~ Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de"
  }
]

About this extraction

This page contains the full source code of the citiususc/hipster GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 162 files (598.6 KB), approximately 149.1k tokens, and a symbol index with 868 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!