Is this language generic/mighty enough to be used for a generic game AI?
up vote
1
down vote
favorite
I want to develop a genetic program that can solve generic problems like surviving in a computer game. Since this is for fun/education I do not want to use existing libraries.
I came up with the following idea:
The input is an array of N integers.
The genetic program consists of up to N ASTs, each of which takes input from some of the array elements and writes its output to a single specific array element.
The ASTs can be arbitrary complex and consist only of four arithmetic operators (+,-,*,/) and can operate on constants and fixed elements of the given array (no random access).
So for [N=3], we have 3 ASTs, for example:
a[0] = a[0] + 1
a[1] = a[0] + a[1]
a[2] = a[0] * 123 + a[1]
The N ASTs are executed one after another and this is repeated infinitely.
Now my question, is this system "mighty" enough (turing complete?) or will it fail to solve some kinds of problems common for an game AI?
artificial-intelligence abstract-syntax-tree evolutionary-algorithm genetic-programming turing-complete
add a comment |
up vote
1
down vote
favorite
I want to develop a genetic program that can solve generic problems like surviving in a computer game. Since this is for fun/education I do not want to use existing libraries.
I came up with the following idea:
The input is an array of N integers.
The genetic program consists of up to N ASTs, each of which takes input from some of the array elements and writes its output to a single specific array element.
The ASTs can be arbitrary complex and consist only of four arithmetic operators (+,-,*,/) and can operate on constants and fixed elements of the given array (no random access).
So for [N=3], we have 3 ASTs, for example:
a[0] = a[0] + 1
a[1] = a[0] + a[1]
a[2] = a[0] * 123 + a[1]
The N ASTs are executed one after another and this is repeated infinitely.
Now my question, is this system "mighty" enough (turing complete?) or will it fail to solve some kinds of problems common for an game AI?
artificial-intelligence abstract-syntax-tree evolutionary-algorithm genetic-programming turing-complete
1
Sounds like Computer Science would be a better fit for this question.
– usr2564301
Nov 3 at 21:24
Thanks for commenting. Is my post clear enough or is some information missing? Maybe I can improve my question.
– codymanix
Nov 4 at 10:39
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I want to develop a genetic program that can solve generic problems like surviving in a computer game. Since this is for fun/education I do not want to use existing libraries.
I came up with the following idea:
The input is an array of N integers.
The genetic program consists of up to N ASTs, each of which takes input from some of the array elements and writes its output to a single specific array element.
The ASTs can be arbitrary complex and consist only of four arithmetic operators (+,-,*,/) and can operate on constants and fixed elements of the given array (no random access).
So for [N=3], we have 3 ASTs, for example:
a[0] = a[0] + 1
a[1] = a[0] + a[1]
a[2] = a[0] * 123 + a[1]
The N ASTs are executed one after another and this is repeated infinitely.
Now my question, is this system "mighty" enough (turing complete?) or will it fail to solve some kinds of problems common for an game AI?
artificial-intelligence abstract-syntax-tree evolutionary-algorithm genetic-programming turing-complete
I want to develop a genetic program that can solve generic problems like surviving in a computer game. Since this is for fun/education I do not want to use existing libraries.
I came up with the following idea:
The input is an array of N integers.
The genetic program consists of up to N ASTs, each of which takes input from some of the array elements and writes its output to a single specific array element.
The ASTs can be arbitrary complex and consist only of four arithmetic operators (+,-,*,/) and can operate on constants and fixed elements of the given array (no random access).
So for [N=3], we have 3 ASTs, for example:
a[0] = a[0] + 1
a[1] = a[0] + a[1]
a[2] = a[0] * 123 + a[1]
The N ASTs are executed one after another and this is repeated infinitely.
Now my question, is this system "mighty" enough (turing complete?) or will it fail to solve some kinds of problems common for an game AI?
artificial-intelligence abstract-syntax-tree evolutionary-algorithm genetic-programming turing-complete
artificial-intelligence abstract-syntax-tree evolutionary-algorithm genetic-programming turing-complete
edited Nov 4 at 10:37
asked Nov 3 at 20:46
codymanix
7918
7918
1
Sounds like Computer Science would be a better fit for this question.
– usr2564301
Nov 3 at 21:24
Thanks for commenting. Is my post clear enough or is some information missing? Maybe I can improve my question.
– codymanix
Nov 4 at 10:39
add a comment |
1
Sounds like Computer Science would be a better fit for this question.
– usr2564301
Nov 3 at 21:24
Thanks for commenting. Is my post clear enough or is some information missing? Maybe I can improve my question.
– codymanix
Nov 4 at 10:39
1
1
Sounds like Computer Science would be a better fit for this question.
– usr2564301
Nov 3 at 21:24
Sounds like Computer Science would be a better fit for this question.
– usr2564301
Nov 3 at 21:24
Thanks for commenting. Is my post clear enough or is some information missing? Maybe I can improve my question.
– codymanix
Nov 4 at 10:39
Thanks for commenting. Is my post clear enough or is some information missing? Maybe I can improve my question.
– codymanix
Nov 4 at 10:39
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
From my perpective the Turing completness of the system is not the main problem here. When using a genetic algorithm to evolve some kind of a strategy applied to some game environment one of the features of the algorithm - that would be helpful - is - I believe - that the small change in the "genome" of the solution lead to a reasonably small change in the behavior. If this is not true then every mutation or cross over can produce an entity that behaves completely different and in this kind of landscape it can be problematic for the genetic algorithm to arrive to some optima - as the landscape of the fitness function is not continuous enough.
Having said that it makes sense to me to try to somehow encode a form of decision tree in the genome and evolve that. However - from my experience - the genetic algorithms in AI for games works best when used to "compute" the optimal values of some parameters of some particular behavior then to "evolve" the behavior itself.
The decision tree in the genome must have the syntax of an abstract syntax tree. Which means, that the grammar follows production rules. This formal grammar has to be evolved, no the genetic algorithm itself.
– Manuel Rodriguez
19 hours ago
Isn't the AST I was proposing a generalisation of a decision tree? Could you please elaborate what you mean by "formal grammar has to be evolved"?
– codymanix
9 hours ago
@codymanix The abstract syntax tree (AST) is the program flow. It's textual representation is sourcecode in a domain specific language for example: “walk, walk, opendoor, walk”. The allowed elements in the AST are called a grammar. A grammar will check, if concrete sourcecode is valid or not. In the example problem two things can be evolved: the grammar itself and a concrete action sequence in the grammar.
– Manuel Rodriguez
8 hours ago
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
From my perpective the Turing completness of the system is not the main problem here. When using a genetic algorithm to evolve some kind of a strategy applied to some game environment one of the features of the algorithm - that would be helpful - is - I believe - that the small change in the "genome" of the solution lead to a reasonably small change in the behavior. If this is not true then every mutation or cross over can produce an entity that behaves completely different and in this kind of landscape it can be problematic for the genetic algorithm to arrive to some optima - as the landscape of the fitness function is not continuous enough.
Having said that it makes sense to me to try to somehow encode a form of decision tree in the genome and evolve that. However - from my experience - the genetic algorithms in AI for games works best when used to "compute" the optimal values of some parameters of some particular behavior then to "evolve" the behavior itself.
The decision tree in the genome must have the syntax of an abstract syntax tree. Which means, that the grammar follows production rules. This formal grammar has to be evolved, no the genetic algorithm itself.
– Manuel Rodriguez
19 hours ago
Isn't the AST I was proposing a generalisation of a decision tree? Could you please elaborate what you mean by "formal grammar has to be evolved"?
– codymanix
9 hours ago
@codymanix The abstract syntax tree (AST) is the program flow. It's textual representation is sourcecode in a domain specific language for example: “walk, walk, opendoor, walk”. The allowed elements in the AST are called a grammar. A grammar will check, if concrete sourcecode is valid or not. In the example problem two things can be evolved: the grammar itself and a concrete action sequence in the grammar.
– Manuel Rodriguez
8 hours ago
add a comment |
up vote
1
down vote
From my perpective the Turing completness of the system is not the main problem here. When using a genetic algorithm to evolve some kind of a strategy applied to some game environment one of the features of the algorithm - that would be helpful - is - I believe - that the small change in the "genome" of the solution lead to a reasonably small change in the behavior. If this is not true then every mutation or cross over can produce an entity that behaves completely different and in this kind of landscape it can be problematic for the genetic algorithm to arrive to some optima - as the landscape of the fitness function is not continuous enough.
Having said that it makes sense to me to try to somehow encode a form of decision tree in the genome and evolve that. However - from my experience - the genetic algorithms in AI for games works best when used to "compute" the optimal values of some parameters of some particular behavior then to "evolve" the behavior itself.
The decision tree in the genome must have the syntax of an abstract syntax tree. Which means, that the grammar follows production rules. This formal grammar has to be evolved, no the genetic algorithm itself.
– Manuel Rodriguez
19 hours ago
Isn't the AST I was proposing a generalisation of a decision tree? Could you please elaborate what you mean by "formal grammar has to be evolved"?
– codymanix
9 hours ago
@codymanix The abstract syntax tree (AST) is the program flow. It's textual representation is sourcecode in a domain specific language for example: “walk, walk, opendoor, walk”. The allowed elements in the AST are called a grammar. A grammar will check, if concrete sourcecode is valid or not. In the example problem two things can be evolved: the grammar itself and a concrete action sequence in the grammar.
– Manuel Rodriguez
8 hours ago
add a comment |
up vote
1
down vote
up vote
1
down vote
From my perpective the Turing completness of the system is not the main problem here. When using a genetic algorithm to evolve some kind of a strategy applied to some game environment one of the features of the algorithm - that would be helpful - is - I believe - that the small change in the "genome" of the solution lead to a reasonably small change in the behavior. If this is not true then every mutation or cross over can produce an entity that behaves completely different and in this kind of landscape it can be problematic for the genetic algorithm to arrive to some optima - as the landscape of the fitness function is not continuous enough.
Having said that it makes sense to me to try to somehow encode a form of decision tree in the genome and evolve that. However - from my experience - the genetic algorithms in AI for games works best when used to "compute" the optimal values of some parameters of some particular behavior then to "evolve" the behavior itself.
From my perpective the Turing completness of the system is not the main problem here. When using a genetic algorithm to evolve some kind of a strategy applied to some game environment one of the features of the algorithm - that would be helpful - is - I believe - that the small change in the "genome" of the solution lead to a reasonably small change in the behavior. If this is not true then every mutation or cross over can produce an entity that behaves completely different and in this kind of landscape it can be problematic for the genetic algorithm to arrive to some optima - as the landscape of the fitness function is not continuous enough.
Having said that it makes sense to me to try to somehow encode a form of decision tree in the genome and evolve that. However - from my experience - the genetic algorithms in AI for games works best when used to "compute" the optimal values of some parameters of some particular behavior then to "evolve" the behavior itself.
answered yesterday
Michal Bida
922322
922322
The decision tree in the genome must have the syntax of an abstract syntax tree. Which means, that the grammar follows production rules. This formal grammar has to be evolved, no the genetic algorithm itself.
– Manuel Rodriguez
19 hours ago
Isn't the AST I was proposing a generalisation of a decision tree? Could you please elaborate what you mean by "formal grammar has to be evolved"?
– codymanix
9 hours ago
@codymanix The abstract syntax tree (AST) is the program flow. It's textual representation is sourcecode in a domain specific language for example: “walk, walk, opendoor, walk”. The allowed elements in the AST are called a grammar. A grammar will check, if concrete sourcecode is valid or not. In the example problem two things can be evolved: the grammar itself and a concrete action sequence in the grammar.
– Manuel Rodriguez
8 hours ago
add a comment |
The decision tree in the genome must have the syntax of an abstract syntax tree. Which means, that the grammar follows production rules. This formal grammar has to be evolved, no the genetic algorithm itself.
– Manuel Rodriguez
19 hours ago
Isn't the AST I was proposing a generalisation of a decision tree? Could you please elaborate what you mean by "formal grammar has to be evolved"?
– codymanix
9 hours ago
@codymanix The abstract syntax tree (AST) is the program flow. It's textual representation is sourcecode in a domain specific language for example: “walk, walk, opendoor, walk”. The allowed elements in the AST are called a grammar. A grammar will check, if concrete sourcecode is valid or not. In the example problem two things can be evolved: the grammar itself and a concrete action sequence in the grammar.
– Manuel Rodriguez
8 hours ago
The decision tree in the genome must have the syntax of an abstract syntax tree. Which means, that the grammar follows production rules. This formal grammar has to be evolved, no the genetic algorithm itself.
– Manuel Rodriguez
19 hours ago
The decision tree in the genome must have the syntax of an abstract syntax tree. Which means, that the grammar follows production rules. This formal grammar has to be evolved, no the genetic algorithm itself.
– Manuel Rodriguez
19 hours ago
Isn't the AST I was proposing a generalisation of a decision tree? Could you please elaborate what you mean by "formal grammar has to be evolved"?
– codymanix
9 hours ago
Isn't the AST I was proposing a generalisation of a decision tree? Could you please elaborate what you mean by "formal grammar has to be evolved"?
– codymanix
9 hours ago
@codymanix The abstract syntax tree (AST) is the program flow. It's textual representation is sourcecode in a domain specific language for example: “walk, walk, opendoor, walk”. The allowed elements in the AST are called a grammar. A grammar will check, if concrete sourcecode is valid or not. In the example problem two things can be evolved: the grammar itself and a concrete action sequence in the grammar.
– Manuel Rodriguez
8 hours ago
@codymanix The abstract syntax tree (AST) is the program flow. It's textual representation is sourcecode in a domain specific language for example: “walk, walk, opendoor, walk”. The allowed elements in the AST are called a grammar. A grammar will check, if concrete sourcecode is valid or not. In the example problem two things can be evolved: the grammar itself and a concrete action sequence in the grammar.
– Manuel Rodriguez
8 hours ago
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53135384%2fis-this-language-generic-mighty-enough-to-be-used-for-a-generic-game-ai%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
Sounds like Computer Science would be a better fit for this question.
– usr2564301
Nov 3 at 21:24
Thanks for commenting. Is my post clear enough or is some information missing? Maybe I can improve my question.
– codymanix
Nov 4 at 10:39