Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions lib/a_star/README.docdown.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# `a_star` - [[ini-desc: a_star]]

[[toc: a_star]]

[[doc: a_star::a_star]]

## Features

[[uml: a_star | format: svg, mentities: a_star::Node;a_star::Link;a_star::Graph;a_star::AStarPath;a_star::PathContext;a_star::ConstantPathContext;a_star::WeightedPathContext;a_star::WeightedLink;a_star::TargetCondition]]

[[features: a_star | mentities: a_star::Node;a_star::Link;a_star::Graph;a_star::AStarPath;a_star::PathContext;a_star::ConstantPathContext;a_star::WeightedPathContext;a_star::WeightedLink;a_star::TargetCondition;a_star::NamedNode;a_star::PositionedNamedNode;a_star::PositionedLink;a_star::PositionPathContext]]

## Running the tests

Run the nitunit automated tests with the following command:

[[testing: a_star]]

## Authors

This project is maintained by [[ini-maintainer: a_star]].
73 changes: 73 additions & 0 deletions lib/a_star/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# `a_star` - A* pathfinding in graphs

* [Features](#Features)
* [Running the tests](#Running-the-tests)
* [Authors](#Authors)

A single graph may have different properties according to the `PathContext` used
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pourquoi cette phrase ici


Usage:

~~~
# Weighted graph (letters are nodes, digits are weights):
#
# a -2- b
# / /
# 3 1
# / /
# c -3- d -8- e
#
var graph = new Graph[Node,WeightedLink]

var na = new Node(graph)
var nb = new Node(graph)
var nc = new Node(graph)
var nd = new Node(graph)
var ne = new Node(graph)

var lab = new WeightedLink(graph, na, nb, 2)
var lac = new WeightedLink(graph, na, nc, 3)
var lbd = new WeightedLink(graph, nb, nd, 1)
var lcd = new WeightedLink(graph, nc, nd, 3)
var lde = new WeightedLink(graph, nd, ne, 8)

var context = new WeightedPathContext(graph)

var path = na.path_to(ne, 100, context)
assert path != null else print "No possible path"

assert path.step == nb
assert path.step == nd
assert path.step == ne
assert path.at_end_of_path
~~~

## Features

![Diagram for `a_star`](uml-a_star.svg)

* `AStarPath` - Result from path finding and a walkable path
* `ConstantPathContext` - Simple context with constant cost on each links
* `Graph` - General graph
* `Link` - Link between two nodes and associated to a graph
* `NamedNode` - Simple node with a name
* `Node` - General graph node
* `PathContext` - Context related to an evocation of pathfinding
* `PositionPathContext` - Context for a graph with positions
* `PositionedLink` - Link for nodes with a position
* `PositionedNamedNode` - Node with a name and position
* `TargetCondition` - Advanced path conditions with customizable accept states
* `WeightedLink` - A `Link` with a `weight`
* `WeightedPathContext` - A `PathContext` for graphs with `WeightedLink`

## Running the tests

Run the nitunit automated tests with the following command:

~~~bash
nitunit .
~~~

## Authors

This project is maintained by **Alexis Laferrière <mailto:alexis.laf@xymus.net>**.
13 changes: 13 additions & 0 deletions lib/actors/README.docdown.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# `actors` - [[ini-desc: actors]]

Example from `actors::agent_simulation`:

[[code: actors::agent_simulation]]

## Features

[[features: actors | mentities: actors::Actor;actors::Mailbox;actors::Message;actors::Proxy;actors::ShutDownMessage;actors::Future;actors::SynchronizedCounter;actors::ActorClockAgent;actors::ActorAgent;actors::MessageClockAgent;actors::ClockAgentMessagenb_steps;actors::ClockAgentMessageagents;actors::ClockAgentMessagenb_finished;actors::ClockAgentMessagedo_step;actors::ClockAgentMessagefinished_step;actors::MessageAgent;actors::AgentMessagedo_step;actors::AgentMessageend_step;actors::AgentMessageothers;actors::AgentMessagecount;actors::AgentMessagegreet;actors::AgentMessagegreet_back;actors::ProxyClockAgent;actors::ProxyAgent;actors::ActorCreature;actors::MessageCreature;actors::CreatureMessageplace;actors::CreatureMessagecolor;actors::CreatureMessageid;actors::CreatureMessagecount;actors::CreatureMessagesamecount;actors::CreatureMessagerun;actors::CreatureMessageto_string;actors::ProxyCreature;actors::ActorFannkuchRedux;actors::MessageFannkuchRedux;actors::FannkuchReduxMessagep;actors::FannkuchReduxMessagepp;actors::FannkuchReduxMessagecount;actors::FannkuchReduxMessageprint_p;actors::FannkuchReduxMessagefirst_permutation;actors::FannkuchReduxMessagenext_permutation;actors::FannkuchReduxMessagecount_flips;actors::FannkuchReduxMessagerun_task;actors::FannkuchReduxMessagerun;actors::ProxyFannkuchRedux;actors::ActorWorker;actors::MessageWorker;actors::WorkerMessageget_byte;actors::WorkerMessageput_line;actors::WorkerMessagework;actors::ProxyWorker;actors::ActorA;actors::MessageA;actors::AMessagefoo;actors::AMessagebar;actors::ProxyA;actors::ActorThreadRing;actors::MessageThreadRing;actors::ThreadRingMessageid;actors::ThreadRingMessagenext;actors::ThreadRingMessagesend_token;actors::ProxyThreadRing]]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

est-ce vraiment maintenable une telle liste?


## Authors

This project is maintained by [[ini-maintainer: actors]].
122 changes: 122 additions & 0 deletions lib/actors/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# `actors` - Nit Actor Model

Example from `actors::agent_simulation`:

~~~
# a "Framework" to make Multi-Agent Simulations in Nit
module agent_simulation is example, no_warning("missing-doc")

import actors

# Master of the simulation, it initiates the steps and waits for them to terminate
class ClockAgent
actor

# Number of steps to do in the simulation
var nb_steps: Int

# List of Agents in the simulation
var agents: Array[Agent]

# Number of agents that finished their step
var nb_finished = 0

fun do_step do
for a in agents do a.async.do_step
nb_steps -= 1
end

fun finished_step do
nb_finished += 1
if nb_finished == agents.length then
nb_finished = 0
if nb_steps != 0 then async.do_step
end
end
end

class Agent
actor

# Doing a step in the simulation
fun do_step do
end

fun end_step do clock_agent.async.finished_step

end

redef class Sys
var clock_agent: ClockAgent is noautoinit,writable
end
~~~

## Features

* `AMessagebar`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

La liste est pas utile

* `AMessagefoo`
* `Actor` - Abstraction of an actor
* `ActorA` - ###################### Actor classes #########################
* `ActorAgent`
* `ActorClockAgent` - ###################### Actor classes #########################
* `ActorCreature` - ###################### Actor classes #########################
* `ActorFannkuchRedux` - ###################### Actor classes #########################
* `ActorThreadRing` - ###################### Actor classes #########################
* `ActorWorker` - ###################### Actor classes #########################
* `AgentMessagecount`
* `AgentMessagedo_step`
* `AgentMessageend_step`
* `AgentMessagegreet`
* `AgentMessagegreet_back`
* `AgentMessageothers` - ###################### Redef classes #########################
* `ClockAgentMessageagents`
* `ClockAgentMessagedo_step`
* `ClockAgentMessagefinished_step`
* `ClockAgentMessagenb_finished`
* `ClockAgentMessagenb_steps`
* `CreatureMessagecolor`
* `CreatureMessagecount`
* `CreatureMessageid`
* `CreatureMessageplace`
* `CreatureMessagerun`
* `CreatureMessagesamecount`
* `CreatureMessageto_string`
* `FannkuchReduxMessagecount`
* `FannkuchReduxMessagecount_flips`
* `FannkuchReduxMessagefirst_permutation`
* `FannkuchReduxMessagenext_permutation`
* `FannkuchReduxMessagep`
* `FannkuchReduxMessagepp`
* `FannkuchReduxMessageprint_p`
* `FannkuchReduxMessagerun`
* `FannkuchReduxMessagerun_task`
* `Future` - The promise of a value which will be set asynchronously
* `Mailbox` - A Blocking queue implemented from a `ConcurrentList`
* `Message` - A Message received by a Mailbox
* `MessageA` - ###################### Messages classes ######################
* `MessageAgent`
* `MessageClockAgent` - ###################### Messages classes ######################
* `MessageCreature` - ###################### Messages classes ######################
* `MessageFannkuchRedux` - ###################### Messages classes ######################
* `MessageThreadRing` - ###################### Messages classes ######################
* `MessageWorker` - ###################### Messages classes ######################
* `Proxy` - Abstraction of proxies for threaded actors
* `ProxyA`
* `ProxyAgent`
* `ProxyClockAgent`
* `ProxyCreature`
* `ProxyFannkuchRedux`
* `ProxyThreadRing`
* `ProxyWorker`
* `ShutDownMessage` - A Message to Rule them all... properly shutdown an Actor
* `SynchronizedCounter` - A counter on which threads can wait until its value is 0
* `ThreadRingMessageid`
* `ThreadRingMessagenext`
* `ThreadRingMessagesend_token`
* `WorkerMessageget_byte`
* `WorkerMessageput_line`
* `WorkerMessagework`

## Authors

This project is maintained by **Romain Chanoir <mailto:romain.chanoir@viacesi.fr>**.
27 changes: 27 additions & 0 deletions lib/ai/README.docdown.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# `ai` - [[ini-desc: ai]]

[[toc: ai]]

## Features

[[uml: ai | format: svg, mentities: ai::ai;ai::backtrack;ai::search]]

### `backtrack` - Basic framework for active backtrack solver

[[doc: ai::backtrack | no-synopsis]]

Example from `ai::queens`:

[[code: ai::queens]]

### `search` - Basic framework for search problems and solver.

[[doc: ai::search | no-synopsis]]

Example from `ai::puzzle`:

[[code: ai::puzzle]]

## Authors

This project is maintained by [[ini-maintainer: ai]].
Loading