Code center > Suggestions
Bot Code Analysis Tool
Prsn828:
I've worked out a mental image of the program structure.
Not that it's important from a user perspective, but I'm basically going to use seperate files (modules) for each functionality.
As far as the interpreter is concerned, I believe I have thought of a good way to handle that.
It will take a while to program though...
Related to the interpreter, I have come up with an interesting thought.
It appears to me that the transition between frames has an effect on a bot's variables that could be represented (with the exception of external stimuli) by something like an excel sheet filled with formulas.
It might be a stretch, but I think I may be able to design an interpreter FORMAT, meaning different formats could represent different versions of darwinbots, or different settings.
The same can also be applied to the sysvars, although I'm also thinking about trying to parse them from the wiki to ensure they are up to date (maybe a file override of sysvars could be allowed as well...)
If I do get a working format for the interpreter, we may want to consider integrating it into darwinbots (since we certainly aren't overwhelmed by the amount of settings it has right now :P)
This would make tweaking the behavior and balance of the program much easier to do.
Now that I think about it, I wonder if it is possible to treat bot-code as a programming language (and as a result, I could make a higher level language that compiles into bot-code...)
I'll play around with that idea a bit after I get some of the other parts coded (or when I can't control my ADHD any more and it forces me to think about it :P)
If anyone can point me to information about how I might query the wiki, it would be greatly appreciated.
As it is right now I can only really display the full page when attempting to provide tool-tips, and without being able to retrieve any actual (read: useful to a program) information, I can't really provide any auto-complete features without hard-coding (or locally storing) all of the related information.
Information in this case refers to: valid keywords (add, sub, mod, etc.), the list of sysvars (and their numbers), the usage of keywords (number and order of arguments), etc.
I'll stop at that for now.
As always I will keep everyone (well-)informed.
Botsareus:
Here is a thought:
Lets say we got:
--- Quote ---*50 2 add 1 sub 50 store
--- End quote ---
Can you make the thing you are working on suggest
--- Quote ---50 inc
--- End quote ---
Or, here is another example
--- Quote ---*50 *50 mult 50 store
--- End quote ---
program suggests:
--- Quote ---*50 2 pow 50 store
--- End quote ---
Please make this work on 'suggest' bases. We don't need the program changing stuff automatically bc there might be an evolutionary advantage in the long-form.
Thank you, keep up the good work.
Prsn828:
--- Quote from: Botsareus on August 24, 2010, 06:56:16 PM ---Here is a thought:
Lets say we got:
--- Quote ---*50 2 add 1 sub 50 store
--- End quote ---
Can you make the thing you are working on suggest
--- Quote ---50 inc
--- End quote ---
Or, here is another example
--- Quote ---*50 *50 mult 50 store
--- End quote ---
program suggests:
--- Quote ---*50 2 pow 50 store
--- End quote ---
Please make this work on 'suggest' bases. We don't need the program changing stuff automatically bc there might be an evolutionary advantage in the long-form.
Thank you, keep up the good work.
--- End quote ---
It will be as you have suggested.
All of those are actually quite good examples of what I am eventually hoping to make it capable of.
In addition, I will probably add in "pointer inference", or the ability to determine if a value (or expression) is supposed to evaluate to a memory location reference.
For individual values followed by the reference operator, this is trivial.
For more complex expressions it could be useful in decyphering the meaning of an evolved code.
I also might add evolution-based optimization.
To explain:
Consider a line of code in a bot.
This code could be considered like a function, as it is deterministic in behavior (except when it involves rnd, but that doesn't really change anything).
By applying a fitness and evaluating mutations of the function, one could evolve a new function, having the same effect on the memory of the bot, but using more or less expressions (or expressions with more or less energy requirements).
Of course, given the resulting change to the memory of the bot, it is theoretically even possible to evolve the code from nothing, but I don't know how useful such a feature might be. (a preson can generally write the code faster than the changes they want it to make, I believe).
And as you said, it would only be suggestions.
It would be quite rude to change the code of the bot without asking :P
Prsn828:
I have a working browser in place, so I can now garuntee wiki-based command descriptions. (Unless the wiki gets removed :P)
I switched to Qt as it has a GUI development tool, and is more fully documented than WxPython. It also has a better browser in its toolkit.
I have the input capturing of the editor set up too, and am going to move handling of the editor's special functionalities into a seperate file soon (right now it is laying around in the initializer).
Thanks to the way Qt's text widget works, I should be able to save in-progress bots along with some meta-data in an HTML format. This is the format the widget uses for formatting, and it has built-in support for reporting as either fully formatted HTML or as plain text. This way I could keep track of what sections are post-fix and what sections are in-fix without any extra coding.
As far as an interpreter goes, I'm considering various approaches, but have not settled on anything yet.
Code conversion will be divided into three categories (or at least right now they are):
* Mutations
* Evolutions
* ConversionsAll three may overlap a little, but for the most part they are distinct.
Mutation is just that, the mutation of the code, whether by switching out for equivalent statements or changing the code altogether.
Evolution makes use of mutation to derive more (or less, if you really want it to) efficient, effective, or desirable (whatever you choose for it to mean) implementations of a section of code.
I might also allow evolving code to meet certain specifications somehow, but for now it's just a thought.
Conversion is more concrete.
It deals with post-fix to/from in-fix, as well as any other non-random algorithm-based conversions (like sysvar to numbers, and comment/uncomment of code)
As always, I will tell you more when I get some more work done on this.
Prsn828:
Big update!
I have the wiki searching working (it definitely isn't in its final state, but it is perfectly usable).
I also have the menu set up.
Right now I am working on implementing the load and save mechanisms (prompts, formats, and all that good stuff).
As soon as saving and loading is complete I will make an executable and provide a link to a download for it.
As always, more news when it happens.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version