dundalek / kmdoc

KMDoc is a software for an intelligent representation of knowledge useful for quick learning and browsing.
43 stars 6 forks source link

Replication of the demo found at "http://kb.knomaton.org/multi-agent-systems/" #1

Closed ATouhou closed 6 years ago

ATouhou commented 6 years ago

Hello. I stumbled across kmdoc's through the demo at markmap.

How do I replicate the demo found at: " http://kb.knomaton.org/multi-agent-systems/ " ? After cloning this repo, what steps are necessary to do to run the software, besides "npm install" ?

dundalek commented 6 years ago

Hi, this is a repo for the tool itself. The actual content is in https://github.com/dundalek/knowledge-base

ATouhou commented 6 years ago

It works great :-) I'm gonna play with it for a while and let you know if I can contribute with anything in the future.

For now only comment would be that some ressources are hardcoded to "http", some of the libraries gives deprecated warnings and that my initial git cloning failed bringing down the external libs that the repository uses - however that is most likely a problem in my environment (freshly installed a week ago).

ATouhou commented 6 years ago

Oh and lastly - It was needed to run npm install inside of node_modules/markmap/ as well :-) else there would be some 404 errors.

dundalek commented 6 years ago

Yeah, I think the ideas are still fresh, but the codebase is a bit old, before the frontend npm modules and bundlers went mainstream.

To clean it up a good start would be to replace the git modules with npm modules and introduce a bundler for build, probably something like parcel might be a good choice.

I will be glad for any kind of help.

ATouhou commented 6 years ago

Actually running the build script reduces the index-mindmap.json to just contain

{ "depth": 1, "line": 1, "name": "Multi-Agent Systems", "children": [ { "name": "Multiagent system", "textId": "multiagent-system", "isDefinition": true } ], "textId": "multi-agent-systems" }

And the index-definitions.json with {"multiagent-system":{"name":"Multiagent system","headers":["Multi-Agent Systems"],"definition":"","source":"mas2013-l01-introduction-v07.pdf#6","id":"multiagent-system"}}

Even though I have the 247 line multi-agent-systems.md

ATouhou commented 6 years ago

https://www.diffchecker.com/iPyhpVeD

dundalek commented 6 years ago

That's strange, when I do a fresh clone it generates the same contents for me. What OS and version of node are you running?

ATouhou commented 6 years ago

Windows 10 (Latest w/u October update) Node v8.11.4

Sidenote: I had some issues with "multimarkdown" not being installed, but after manually installing it, it allowed me to compile.

[EDIT] I just noticed a "message" YAML error: { [Error: Unable to parse.] message: 'Unable to parse.', parsedLine: 3, snippet: 'Agent @mas2013-l01-introduction-v07.pdf#15' } in text:

ATouhou commented 6 years ago

After updating the yamljs dependency to 0.3.0 it still gave same error.

Removing " \n " from the document allows it to compile without throwing the catch exception. The index.html document then compiles correctly but at the expense of the json index'es.

The console.log of buf variable when join('\n') looks like this:

definition: is a collection of multiple autonomous agents, each acting towards its objectives while all interacting in a shared environment, being able to communicate and possibly coordinate their actions.</p>
<p>Agent @mas2013-l01-introduction-v07.pdf#15
: |
[Russell &amp; Norvig] An agent is anything that can perceive its environment (through its sensors) and act upon that environment (through its effectors).<br>[Wooldridge &amp; Jennings] An agent is a computer system that is situated in some environment, and that is capable of autonomous action in this environment in order to meet its design objectives/delegated goals.</p>
<h3><a id="user-content-autonomous-agent-properties" class="anchor" aria-hidden="true" href="#autonomous-agent-properties"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Autonomous Agent Properties</h3>
<p>autonomous @mas2013-l01-introduction-v07.pdf#18
: the agent is self goal-directed and acts without requiring user initiation and guidance; it can choose its own goal and the way to achieve it; its behavior is determined by its experience; we have no direct control over it</p>
<p>reactive @mas2013-l01-introduction-v07.pdf#18
: the agent maintains an ongoing interaction with its environment, and responds to changes that occur in it</p>
<p>proactive @mas2013-l01-introduction-v07.pdf#18
: the agent generates and attempts to achieve goals; it is not driven solely by events but takes the initiative</p>
<p>sociable @mas2013-l01-introduction-v07.pdf#19
: the agent interacts with other agents (and possibly humans) via cooperation, coordination, and negotiation; it is aware and able to reason about other agents and how they can help it achieve its own goals</p>
<p>coordination @mas2013-l01-introduction-v07.pdf#19
: is managing the interdependencies between actions of multiple agents (not necessarily cooperative)</p>
<p>cooperation @mas2013-l01-introduction-v07.pdf#19
: is working together as a team to achieve a shared goal</p>
<p>negotiation @mas2013-l01-introduction-v07.pdf#19
: is the ability to reach agreements on matters of common interest</p>
<ul>
<li>An agent has unpredictable behaviour as observed from the
outside, unless its simple reflexive agent.</li>
<li>An agent is situated in the environment.</li>
<li>Agent communication model is asynchronous.</li>
<li>Objects do it for free; agents do it because they want to.</li>
</ul>

Before "buf" variable is joined on \n it looks like this (console.logged): [ 'definition: is a collection of multiple autonomous agents, each acting towards its objectives while all interacting in a shared environment, being able to communicate and possibly coordinate their actions.</p>', '<p>Agent @mas2013-l01-introduction-v07.pdf#15', ': |', '[Russell &amp; Norvig] An agent is anything that can perceive its environment (through its sensors) and act upon that environment (through its effectors).<br>[Wooldridge &amp; Jennings] An agent is a computer system that is situated in some environment, and that is capable of autonomous action in this environment in order to meet its design objectives/delegated goals.</p>', '<h3><a id="user-content-autonomous-agent-properties" class="anchor" aria-hidden="true" href="#autonomous-agent-properties"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Autonomous Agent Properties</h3>', '<p>autonomous @mas2013-l01-introduction-v07.pdf#18', ': the agent is self goal-directed and acts without requiring user initiation and guidance; it can choose its own goal and the way to achieve it; its behavior is determined by its experience; we have no direct control over it</p>', '<p>reactive @mas2013-l01-introduction-v07.pdf#18', ': the agent maintains an ongoing interaction with its environment, and responds to changes that occur in it</p>', '<p>proactive @mas2013-l01-introduction-v07.pdf#18', ': the agent generates and attempts to achieve goals; it is not driven solely by events but takes the initiative</p>', '<p>sociable @mas2013-l01-introduction-v07.pdf#19', ': the agent interacts with other agents (and possibly humans) via cooperation, coordination, and negotiation; it is aware and able to reason about other agents and how they can help it achieve its own goals</p>',

To me it looks like somehow the beginning spaces when converted from MarkDown -> YAML are missing?

ATouhou commented 6 years ago

Changing line 127 in knowledge-base/components/kmdoc/index.js to buf.push(' '+ line); fixes the issue it seems.... The demo now runs without any apparant errors at: https://touhou.dk/fiqh/multi-agent-systems/

So problem solved I guess? Or.... so time will show xD