This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The MIT License | |
* | |
* Copyright (c) 2013 Pablo R. Mier <pablo.rodriguez.mier@usc.es>. | |
* Centro de Investigación en Tecnoloxías da Información (CITIUS) http://citius.usc.es | |
* | |
* Permission is hereby granted, free of charge, to any person | |
* obtaining a copy of this software and associated documentation | |
* files (the "Software"), to deal in the Software without | |
* restriction, including without limitation the rights to use, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a simple weighted directed graph with Hipster where | |
// vertices are Strings and edge values are just doubles | |
HipsterDirectedGraph<String,Double> graph = GraphBuilder.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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Builder example with Hipster | |
Hipster.SearchProblem p = | |
ProblemBuilder.create() | |
.initialState(initialState) | |
.defineProblemWithExplicitActions() | |
.useActionFunction(af) | |
.useTransitionFunction(atf) | |
.useCostFunction(cf) | |
.useHeuristicFunction(hf) | |
.build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Action { UP, DOWN, LEFT, RIGHT } | |
Hipster.SearchProblem p = | |
ProblemBuilder.create() | |
.initialState(Arrays.asList(5,4,0,7,2,6,8,1,3)) | |
.defineProblemWithExplicitActions() | |
.useActionFunction(new ActionFunction<Action, List<Integer>>() { | |
public Iterable<Action> actionsFor(List<Integer> board) { | |
return validMovements(board); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Action { UP, DOWN, LEFT, RIGHT } | |
Hipster.SearchProblem p = | |
ProblemBuilder.create() | |
.initialState(Arrays.asList(5,4,0,7,2,6,8,1,3)) | |
.defineProblemWithExplicitActions() | |
.useActionFunction( (state) -> return validMovementsFor(state) ) | |
.useTransitionFunction( (action, state) -> applyActionToState(action, state) ) | |
.useCostFunction( (transition) -> return 1d ) | |
.build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cd /tmp | |
wget https://oss.sonatype.org/service/local/repositories/releases/content/es/usc/citius/hipster/hipster-all/1.0.0-rc2/hipster-all-1.0.0-rc2.jar | |
java -cp hipster-all-1.0.0-rc2.jar es.usc.citius.hipster.examples.ASCIIMazeVisualizer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version='1.0' encoding='UTF-8'?> | |
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.1/graphml.xsd"> | |
<key id="c1" for="edge" attr.name="c1" attr.type="int" /> | |
<key id="c2" for="edge" attr.name="c2" attr.type="int" /> | |
<graph id="G" edgedefault="directed"> | |
<node id="v1" /> | |
<node id="v5" /> | |
<node id="v6" /> | |
<node id="v4" /> | |
<node id="v3" /> |
OlderNewer