forked from nitlang/nit
-
Notifications
You must be signed in to change notification settings - Fork 2
New readmes #366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Morriar
wants to merge
2
commits into
master
Choose a base branch
from
NEW-READMES
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
New readmes #366
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| 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]]. |
This file contains hidden or 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
| 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 | ||
|
|
||
| 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 | ||
|
|
||
|  | ||
|
|
||
| * `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>**. | ||
This file contains hidden or 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
| 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]] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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]]. | ||
This file contains hidden or 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
| 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` | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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>**. | ||
This file contains hidden or 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
| 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]]. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pourquoi cette phrase ici