Re: Static vs Dynamic
From: Darren (pyedarren_at_hotmail.com)
Date: 10/27/04
- Next message: Pascal Costanza: "Re: Static vs Dynamic"
- Previous message: Frank Buss: "Re: C++ sucks for games"
- In reply to: Kaz Kylheku: "Re: Static vs Dynamic"
- Next in thread: Jacek Generowicz: "Re: Static vs Dynamic"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 27 Oct 2004 05:39:10 -0700
kaz@ashi.footprints.net (Kaz Kylheku) wrote in message
[..]
An interesting program. What kind of program is this? AI, a language,
or something else? (just curious)
> - smaller patches to implement a change
> - less stuff to *read* and *understand*
> - ability to experiment with changes to the program without having to
> make irrelevant adjustments just to get it to compile!
>
> This last point is important. I've done some refactorings of Lisp code
> where I didn't acually fix the entire program all at once. I
> experimented with a risky change and ended up with a half-broken
> program. But enough of that program worked that I was able to get it
> running and test just the new modifications, being careful not to step
> on the broken parts. Once I knew that I was going in the right
> direction and thus ``de-risked'' the proposed change, I began to
> ripple it through the rest of the program, gaining more and more
> confidence as more and more of the program worked with the new data
> structures.
I have written a similar kind of application in Java that uses a
context class and a node class which has an implementation of the
Command pattern inside of it. What the program does basically is
reads a chunk of text and through multiple passes (building up a tree
based on groups and previous "knowledge"), recognizes "concepts"
contained within it. Each subsequent pass on the newly formed tree
recognizes higher and higher level "concepts". Its basciallly a
learning program that can identify commonalities in textual structure.
The knowledge and concepts can be serialized and applied during in
future runs. That way you teach it a little bit at a time. Start
with letters, work up to teaching it words, etc.
First lesson might be like this:
H
E
L
O
Now anytime it sees H,E,L,O again, it has knowledge and a concept to
represent them.
Second lesson:
HELLO
First pass recognizes the letters and identifies them as being of the
same concept. The second pass builds a new concept branch with 5
nodes containing the concepts of letters H, E, L, L, O. Each of those
subsequently point to a single "knowledge" that contains (knowledge is
something with concrete data) of a single type Letter (its not named,
but it has the concept of a Letter by now learned in the first lesson
along with the letters). After the second pass it has the new concept
of a word with the knowledge of a word containing the characters HEL(2
knowledge instances, one concept "L" of type letter)O . Its more
complicated then that, but you get the idea.
Further teaching identifies phrases, sentences, etc. Basically
whatever you want to throw at it. You can throw source code at it and
have it learn the structure of a language for example and know and
recognize it in the future.
Evaulations, comparisions and other operations are done on nodes by
executing the "commands" they contain. Knowledge reacts one way,
concepts another (there are also other types of primitive concepts for
finite data identification "Char", etc). The nodes all have the same
base inheritance of "Node" and return command objects.
The application doesn't use casting because it only needs to deal with
subclasses of node objects and command objects for everything and
those objects don't require additional external methods.
My point is just that you can get the same kind of beneifts you
outlined in your explanation by the design. Excessive or unecesary
casting in Java (or any type sensetive OO language) tends to be a
result of bad design in my experience.
- Next message: Pascal Costanza: "Re: Static vs Dynamic"
- Previous message: Frank Buss: "Re: C++ sucks for games"
- In reply to: Kaz Kylheku: "Re: Static vs Dynamic"
- Next in thread: Jacek Generowicz: "Re: Static vs Dynamic"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|