473,699 Members | 2,697 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

emergent/swarm/evolutionary systems etc

Hello, I'm Peter, and I'm very much a newbie.

New in the sense of being a novice at everything to do with programming,
rather than just new to Python, so please be very explicit in your replies
(should you deem me worth of such attention). I've long had a passing
interest in programming from a macro-conceptual level, but only very
recently have I tried to learn the details of how to impliment my ideas in
code. Since I'm so inexperienced and learning soley from on-line
documentation in my sparse spare time, I'm finding the learning curve rather
steep, and would appreciate it if you didn't assume that I 'know' anything
(especially with formating issues).

What instigated my uptake of programming was a recently sparked, and rapidly
growing interest in emergent processes, and particularly of computer
applications for them. I've not covered more than 20 hours of good study on
the subject (accounting for liberal procrastination ), but I like to jump in
the deep end with things, and the logic of emergence really 'clicks' with my
brain. I have, however covered biological evolution in considerably more
depth, so I'm already quite familiar with the concepts involved.

What I've been trying to do with Python is to set up something resembling
John Von Neumann's conception of an imperfectly self-replicating program:

(3.2.1 Self-Reproduction
Nearly all of the practical implementations of arti cial worlds to be
described are related
in some way to the seminal work of John von Neumann. In the late 1940s and
early
1950s, he devoted considerable time to the question of how complicated
machines could
evolve from simple machines.9 Speci cally, he wished to develop a formal
description of
a system that could support self-reproducing machines which were robust in
the sense
that they could withstand some types of mutation and pass these mutations on
to their
o spring. Such machines could therefore participate in a process of
evolution.
Inspired by Alan Turing's earlier work on universal computing machines
[Turing 36],
von Neumann devised an architecture which could ful l these requirements.
The ma-
chine he envisaged was composed of three subcomponents [von Neumann 66]:
1. A general constructive machine, A, which could read a description (X) of
an-
other machine, X, and build a copy of X from this description:
A + (X) ; X (3.1)
(where + indicates a single machine composed of the components to the left
and
right suitably arranged, and ; indicates a process of construction.)
2. A general copying machine, B, which could copy the instruction tape:
B + (X) ; (X) (3.2)
9 Von Neumann had diculties in de ning precisely what the term
`complicated' meant. He said \I
am not thinking about how involved the object is, but how involved its
purposive operations are.
In this sense, an object is of the highest degree of complexity if it can do
very dicult and involved
things." [von Neumann 66].
3.2. PREVIOUS WORK 47
3. A control machine, C, which, when combined with A and B, would rst
activate
B, then A, then link X to (X) and cut them loose from (A + B + C):
A + B + C + (X) ; X + (X) (3.3)
Now, if we choose X to be (A + B + C), then the end result is:
A + B + C + (A + B + C) ; A + B + C + (A + B + C) (3.4)
This complete machine plus tape, [A + B + C + (A + B + C)], is therefore
self-
reproducing. From the point of view of the evolvability of this
architecture, the crucial
feature is that we can add the description of an arbitrary additional
automaton D to
the input tape. This gives us:
A + B + C + (A + B + C + D) ; A + B + C +D + (A + B + C + D) (3.5)
Furthermore, notice that if the input tape (A + B + C +D) is mutated in
such a
way that the description of automaton D is changed, but that of A, B and C
are
una ected|that is, the mutated tape is (A + B + C +D0)|then the result of
the
construction will be:
A + B + C+ D + (A + B + C + D) mutation
; A + B + C + D0 + (A + B + C+ D0)
(3.6)
The reproductive capability of the architecture is therefore robust to some
mutations
(speci cally, those mutations which only a ect the description of D), so the
machines
are able to evolve. Von Neumann pointed out that it was the action of the
general copy-
ing automaton, B, which gave his architecture the capacity for evolving
machines of
increased complexity, because B is able to copy the description of any
machine, no mat-
ter how complicated [von Neumann 66] (p.121). This ability is clearly
demonstrated in
Equation 3.5 above.

From Artificial Evolution to Artificial Life
Timothy John Taylor
Ph.D
University of Edinburgh
1999)

-The formatting on the equations is a bit messed up, but I hope you get the
idea.

Although the concept is quite straight forward, and I have my own ideas
about what specific features I'd like to include, I'm usure as to how to
implement it at the level of coding. Basically, I wish to create:
1. An entirely human-designed evolutionary engine.
2. A file that it '1' will acess, modify, test against a goal to retrive a
score, then save with the modifications intact and ready for the next run or
loop-cycle.
3. A buffer that will store a population of these files.
4. A death engine that will remove low scoring files (probably as a part of
'1')

These concepts aren't new, and are already well publicised. Variants of
them are used for determining coefficient values for engeneering, medical
etc research, but I wish to create a program that's more open ended than a
number-finder. The Neumann model is incomplete, since it not only fails to
specify a method for mutation beyond the vague decription given, but also
fails to account for the vanishingly small chance that completely random
mutation of a program would produce any intelligible results relative to the
processor's capacity for run cycles (overlooked, perhaps, because of an
over-riding focus on making the evolutionary engine robust to mutation). To
solve this, I propose an 'incubator' approach, where the engine would, as
part of its evolutionary toolkit, and particularly at the beginnng of the
process before the code becomes complex enough to allow the likelyhood of
non-fatal mutations, scavange code from external sources.

Regardless of any issues of copyright etc, this has the advantage of basing
the now-less random mutations on code that is known to be operable, rather
than the infinite monkies approach of random alphanumeric generation. To
incorporate this and other revisions and refinements that I've just spotted,
the program structure would look like so:

An entirely human-designed evolutionary engine, which:
1. Allows the user to set a goal.
2. Takes random sections of code from a library.
3. Places them in a text file.
4. Applies a 'scatter shot' of random alphanumeric changes (with either a
random or a user specified % of alpahnumerals changed)
5. Runs the file.
6. Scores the file on how many valid lines it has, if it fufilled the goal,
how long it took, etc.
7. Saves the score to the file (in the title?).
8. Repeats for a user specified number of times.
9. Selects the best programs, deletes the rest
10. Returns to '3' and repeats until stopped.

At the moment, I'm not even sure if python can create, chop and change
files, so that the effects of a program being run can persist after it's
closed down. The library modules are still largely incomprehensibl e to me,
both in their function and their implementation. I'm a very long way from
understanding how to apply the randomised aspects of the file changes, or
much else for that matter, and I can already see a bunch of things that
would need a lot of tweaking, even if the structure is sound (this is the
first proper program I've planned, which I'm sure means that the structure
is almost certaintly gibberish).

Other things that would be handy:

A bit to make sensible sections of code less vunerable to mutation, and
concentrate changes in 'junk' areas.

Something to decrease or prevent the addition of scavanged code when the
proportion of scavanged code to random alphanumeric changes and working
code, or vice versa (with working code forming the fulcrum of the dynamic).

A 'skills' counter/protector, that would allow files to retain redundant
code if their goal was changed, rather than necessarily losing it to the
pressure of clock cycles and the equivalent of genetic drift. (For this,
the 'bastion' module looks like it might be useful, though I'm not terribly
sure about how it works, or 'exactly' what it does)

An random goal changer, to provide an impetus for constant evolution without
the need for user input. (There's only so good you can be at any one thing)

An option to give the files an internal copy of the evolution engine, which
could then be modified by itself as it alters the entire file. (This may
prove difficult, as although this would allow the files to develop more
efficient strategies for the process of evolution itself, it would make them
more vunerable to fatal mutations. A possible solution would be to have a
'nuclear membrane' - a guard to prevent mutations that are particularly
likely to be fatal eg. mutations that alter significant chunks of the
engine. It would also be possible to have multiple engines in each cell,
which could self-assess and compare scores, replacing engines that
underperform through damage or 'under-evolution' (radiation resistant
bacteria use a similar technique)
=============== ===
All of this seems like a rather tall order, especially as I'm still
struggling with some of the things from the beginners guide. Although I
should probably buy a book and work my way through lots of examples of
increasing complexity, I like to tackle things head-on and learn as I go.
Even just writing this message has helped me to clarify to myself what it is
I want to do.

If anybody has even bothered to read this far, I'd ask you please to give
some thought to these ideas (of myself and others), and perhaps to give me
some pointers in the right direction. Thankyou.
Jul 18 '05
34 2187
On Fri, 2 Apr 2004, Peter MacKenzie wrote:
import sys
You don't need the sys module for file I/O.
file = 'myfile.txt'
open(file,'r+b' )
file.write("som e string of what you want to write")
file.close()


"file" is a str object containing the string "myfile.txt ". What you need
to do is catch the return value (a file object) of the open() function and
use that for writing:

file = "myfile.txt "
fh = open(file, "r+") ## Do you need "b" (binary) for a text file?
fh.write("somet hing")
fh.close()

Cheers,

/Mickel

--
Mickel Grönroos, application specialist, linguistics, Research support,CSC
PL 405 (Tekniikantie 15 a D), 02101 Espoo, Finland, phone +358-9-4572237
CSC is the Finnish IT center for science, www.csc.fi

Jul 18 '05 #11
On Fri, 2 Apr 2004 10:16:19 +0000 (UTC), "Peter MacKenzie"
<pe*******@btin ternet.com> wrote:
I'll take that to mean that my chances are slim. Although this probability
is mediated my lack of a social life, I've conceived of a contingency
wherein a standard spreadsheet application could be used to facilitate at
least some limited degree of modelling. Given your recommendation, I'll
ensure the feasibility of this option before I commit to the primary
methodology, thereby ensuring that a disappointing rate of progress doesn't
prove fatal for my dissertation.

Fortunately, I've found an online textbook at
http://www.ibiblio.org/obp/thinkCSpy/index.htm, which appears better suited
to my needs than the standard python documentation, and may alleviate some
of the conceptual and syntactical difficulties I've been experiencing.

I expect I may be back here for additional aid in the near-future.

The spreadsheet approach may be a suitable alternative, indeed.
In the past, I've taught some friends with an accounting background
a little about programming, using spreadsheet formulae as examples.

Actually, spreadsheets might even have an advantage in your case,
because the calculations are performed simultaneously, for all intents
and purposes. You don't need to control the "flow". This is a common
characteristic of "simulation languages", also. In them, you set up
your equations, relationships, dependencies, etc, provide initial
conditions, and let them run. There is very little of the linear
sequencing of steps that occurs in most popular languages (python,
C(etc), lisp/scheme, pascal).

To simulate "generation s", you will probably need to write a macro
that copies one generation to the next (column, or separate sheet).
This is ironic, given that the Von Neumann paper that started your
interest in the subject is about copying a machine/program.

Best of luck,
--dang
Jul 18 '05 #12
Peter Hansen + Mickel Grönroos, (unsure of a more suitable intro protocol
for this environment + situation)

Oh the joy! It makes life worth living when things click into place and
make sense. My style of learning seems ill suited to the material available
on the subject, so although I had indeed read all that I could find on
making files, it was presented in a manner that I couldn't quite comprehend.
To elaborate, I process linguistic information in a holistic, intuitive
manner; a quality that requires for me to develop a 'feel' for the language
in question, rather than a literal understanding of the rules.

Because of this, I need full-yet-simple working examples to deconstruct and
process. Most of the examples I've come across have been fragmented and
incomplete, which leaves me grasping at loose ends and the countless
possibilities therein. It's as though somebody had handed me at birth a
dictionary and a set of grammatical rules, with the expectation that I would
be able to piece it all together and learn to communicate.

Conversely, my search for the working examples I craved only turned up
applications of the process that were too bound up in more complex matters
to be decipherable, the analogy this time being that of getting handed a
copy of 'Moby Dick' from which to start my education.

Being presented with an isolated, sterilised 'specimen' has helped me to
form a better understanding of the language, being of the right mix of
information bandwidth vs. complexity to allow me to capture the 'flavour' in
the code.

If there are any teachers reading this, I hope it might engender you to
consider the varying needs of students in your classes. By being an outlier
on the mental demographic, I've long suffered from problems arising from my
minority neurology. The cause, however, has generally been from
communicative frictions, rather than from the relative merits and demerits
of that mental architecture.

Thank you both for your help (spreadsheets in the next message).
Jul 18 '05 #13
Peter MacKenzie wrote:
Oh the joy! It makes life worth living when things click into place
and make sense.


I know the feeling. For me too, the best way to learn a new language is
to wallow in working examples. I still remember the thrill of hacking
my way through Tom Swan's "Mastering Turbo Pascal" in the late
eighties, where he presented every wrinkle of the language, and every
single library function with both a working example program and a lucid
discussion. I've never learnt any other computer language so
thoroughly.

regards,
--
Leif Biberg Kristensen
http://solumslekt.org/
Validare necesse est
Jul 18 '05 #14
Peter MacKenzie wrote:
Peter Hansen + Mickel Grönroos, (unsure of a more suitable intro protocol
for this environment + situation)

Oh the joy! It makes life worth living when things click into place and
make sense. My style of learning seems ill suited to the material available
on the subject, so although I had indeed read all that I could find on
making files, it was presented in a manner that I couldn't quite comprehend.
To elaborate, I process linguistic information in a holistic, intuitive
manner; a quality that requires for me to develop a 'feel' for the language
in question, rather than a literal understanding of the rules.

Because of this, I need full-yet-simple working examples to deconstruct and
process. Most of the examples I've come across have been fragmented and
incomplete, which leaves me grasping at loose ends and the countless
possibilities therein. It's as though somebody had handed me at birth a
dictionary and a set of grammatical rules, with the expectation that I would
be able to piece it all together and learn to communicate.


Sounds like you should check out www.diveintopython.org, which as I
recall has quite full examples. If you haven't read it already do so.

The only other thing I can suggest is spend less time defending your
way of learning things :-) and more time just *doing* it. Write code,
and when it doesn't work at first, experiment. Python should be
learned with the interactive interpreter prompt right in front of
you, typing and watching and learning...

Anyway, keep at it. Python is certainly one of the easiest if not
the easiest modern language to learn (IMHO) so you should find yourself
making relatively good progress, whatever your difficulties.

-Peter
Jul 18 '05 #15
Spreadsheets do seem to be an attractive option, but the benefits are not
without their detractors:

+Easy to work with
+Require no/limited skill acquisition
+Flexible

-Cells can only hold single items of data (which can be worked around by
using arrays of cells to hold multiple attributes for each location)
-Require no/limited skill acquisition (being familiar and honest with my own
psychological composition, I know that the only way I'm likely to develop a
fair degree of programming competence is if there's a driving pressure to do
so. It's something I'd like to learn, and this gives me the excuse/leverage
to do so.)

Unknowns: Time series graphical output would be necessary, even if it's
very primitive. Do you know if the spreadsheet could be set up in such a
way that cells would change colour depending on their values, or if the
graph making facilities would be able to create reasonable representations
of said values so that a series of graphs would be capable of showing up
phenomena with fluidic (wavelike, turbulent, etc) characteristics ?

I'm afraid the temptation to take the hard route my prove too great
(psychological paradoxes: I always feel good about feeling so terrible about
these things after I've passed the point of no return in the undertaking,
and the enormity of the task at hand sinks in - it's a whole adrenalin
thing), but I'd still like to make a comprehensive assessment of my options
before I commit to anything.
Jul 18 '05 #16
> fh = open(file, "r+") ## Do you need "b" (binary) for a text file?

Of course not, but keeping that binary flag allows you to get all the
information from a file when you are on windows. Depending on the
contents, this is not always the case.

Inserting the binary flag in *nix doesn't hurt anything.

- Josiah
Jul 18 '05 #17
Leif B. Kristensen wrote:
I know the feeling. For me too, the best way to learn a new language
is to wallow in working examples.


Same here. That's how I learned Perl. I picked up the basics from
Learning Perl, but no clear sense of how to use it for my purposes.
Then I picked up Programming Perl and got thoroughly intimidated. Then
I found the Perl Cookbook and fairly quickly learned what I needed to
know by scarfing the example code and modifying it for my purposes.

Now I find I'm following almost exactly the same trajectory with Python.
I have Learning Python and Programming Python, and just recently got a
copy of the Python Cookbook. Yeah, this is gonna work out fine.

Jul 18 '05 #18
On Fri, 2 Apr 2004 16:58:32 +0000 (UTC), "Peter MacKenzie"
<pe*******@btin ternet.com> wrote:
Spreadsheets do seem to be an attractive option, but the benefits are not
without their detractors: ....-Require no/limited skill acquisition (being familiar and honest with my own
psychologica l composition, I know that the only way I'm likely to develop a
fair degree of programming competence is if there's a driving pressure to do
so. It's something I'd like to learn, and this gives me the excuse/leverage
to do so.)
Sorry I can't help you with that one--it's for you to decide.
Unknowns: Time series graphical output would be necessary, even if it's
very primitive. Do you know if the spreadsheet could be set up in such a
way that cells would change colour depending on their values, or if the
graph making facilities would be able to create reasonable representations
of said values so that a series of graphs would be capable of showing up
phenomena with fluidic (wavelike, turbulent, etc) characteristics ?
I don't know what spreadsheet you're using, but I know Microsoft Excel
support conditional coloring.
I'm afraid the temptation to take the hard route my prove too great
(psychologic al paradoxes: I always feel good about feeling so terrible about
these things after I've passed the point of no return in the undertaking,
and the enormity of the task at hand sinks in - it's a whole adrenalin
thing), but I'd still like to make a comprehensive assessment of my options
before I commit to anything.


It's a complex project. I'm pretty sure a spreadsheet is capable of
performing the calculations, but it may not be the best to provide
the graphical result you're looking for. On the other hand, maybe it
could generate the numbers for the graphics, and then you could have
a second program that reads the numbers to perform only the
graphics operations.

I agree with Josiah--two months is tight. I suggest if you're more
comfortable with a spreadsheet, start with a minimal "program" in
the spreadsheet. Realize that writing a python program will
require you to make many of the same design / algorithm decisions
as the spreadsheet.

--dang
Jul 18 '05 #19
I think then that I might stick with spreadsheets as far a possible. Do you
know of any simulation programs that might be more suited? Also, how would
you extract data from a spreadsheet for use in another program? I'm not
familiar with means of linking spreadsheets to external applications, though
I don't doubt that it can be done.
Jul 18 '05 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2346
by: A Waterfall That Barks | last post by:
http://www.c-sharpcorner.com//Code/2003/March/SwarmSim.asp I just found this port of the swarm groups famous 'complexity from simple interacting agents' type software. Very easy to load and run in Studio. I'm going to try a mono build when I get home...don't know about how to translate the GDI though.
2
2854
by: Scott Robert Ladd | last post by:
I've just posted my analysis of GNU C and C++ optimizations, using a genetic algorithm to discover the most effective optimization flags for different algorithms. ACOVEA (Analysis of Compiler Options via Evolutionary Algorithm) implements a genetic algorithm to find the "best" options for compiling programs with the GNU Compiler Collection (GCC) C and C++ compilers. "Best", in this context, is defined as those options that produce the...
0
1167
by: louis | last post by:
For those in the DFW area, there's an IT open house at Perot Systems. (In my group, we're looking to hire one senior sql server DBA. Go to the perot systems web site to apply). ------------------------------------------------------------ You're Invited to Perot Systems IT Career Open House - July 14, 2005 To meet our growth needs, Perot Systems is hosting an IT Career Open House at the company's Plano campus. If you have the skills...
0
1417
by: avinash | last post by:
EIGHTEENTH INTERNATIONAL CONFERENCE ON SYSTEMS ENGINEERING (ICSEng05) LAS VEGAS, USA, AUGUST 16-18, 2005 (http://www.icseng.info) This series of International Conferences is jointly organized on a rotational basis among three institutions, University of Nevada, Las Vegas, USA, Technical University of Wroclaw, Poland, and Coventry University, UK. In August 2005, the 18th International Conference will be held in Las Vegas, NV, at the...
0
1788
by: Emine Ekin | last post by:
/*Apologize for multiple posts*/ FIRST CALL FOR PAPERS ADVIS 2006 Fourth Biennial International Conference on Advances in Information Systems 18-20 October, 2006 Izmir, Turkey
0
2477
by: Bill Law | last post by:
Great Company on the Maryland Eastern Shore needs a DB2 Systems Programmer and DBA (DB2) to join their IT team. The selected candidate MUST have a BS degree and both DB2 DBA And DB2 Systems Programming experience. The salary range for this position is 80-85K range..tops.
3
2481
by: user | last post by:
Hi all, At the outset, I regret having to post this slightly OT post here. However, I strongly feel that people in this group would be the best to advise me on my predicament. I am working as a QA in an MNC in India, since I graduated in September 2003. I am working in a QA role which requires me to do some Winrunner automation, and modifying/creating a framework in Perl for Automated Regression Testing of some command Line utilities...
54
5841
by: Matt | last post by:
How do we define systems programs? when we say systems programming, does it necessary mean that the programs we write need to interact with hardware directly? For example, OS, compiler, kernel, drivers, network protocols, etc...? Couple years ago, yes, I understand this is definitely true. However, as the software applications become more and more complicated, some people try to argue that. Some people argue the definition of systems...
3
6695
by: Ty Oft | last post by:
Hello Bytes! Maybe my question seems a bit silly (as one could simply answer it "Well, what are you more passionate about?" or stuff like that - please don't answer like this), but I am in a bit of a dilemma and time is short at the moment and I need to make a decision before it's too late. I have just begun my second year in a UK uni for a BSc Hons Web Systems Development but I am not that happy about the course. Very diluted in my opinion....
0
8687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9174
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9034
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7750
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6534
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5874
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2347
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2009
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.