PROGRAMMING WITH PYTHON – Simple Programming Environment with ubuntu 16.04

emerging-mind.org eJournal ISSN 2567-6466
Email: info@emerging-mind.org
10.-12.February 2018
Author: Gerd Doeben-Henisch
gerd@doeben-henisch.de
February 12, 2018

IDEA

This text describes a simple programming environment for python3
in an ubuntu 16.04 environment.

Contents

1 The Environment …  1
2 Steps To Prepare Python Environment …  2
3 Use Python Interactive Console …  3
4 Debugging with the Code Module …  6

PDF

PROGRAMMING WITH PYTHON. First Test Results with Fixed-Rule and Random-Rule Actors

emerging-mind.org eJournal ISSN 2567-6466
Email: info@emerging-mind.org
3.Dec 2017
Author: Gerd Doeben-Henisch
Email: gerd@doeben-henisch.de

Contents

1 Discussion… 2
1.1 Expectations . . . . . . . . . . . . . . . . . . . . . . . . . . .2
1.2 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Consequences . . . . . . . . . . . . . . . . . . . . . . . . . .4
2 Data Fixed-Rule Actor… 4
2.1 EXPERIMENT 1 …4
2.2 EXPERIMENT 2 …5
2.3 EXPERIMENT 3 …5
2.4 EXPERIMENT 4 . ..5
3 Data Random-Rule Actor..10
3.1 EXPERIMENT 1 . . .10
3.2 EXPERIMENT 2 . . .10
3.3 EXPERIMENT 3 . . .10
3.4 EXPERIMENT 4 . . . .10

Abstract

A first series of tests have been realized with fixed-rule actors and
random-rule actors. The results show, that there is no clear correlation
between the mean amount of energy and the death-rate of an actor
(-0.78 fixed rule Actor), (-0.71 random rule actor). Between the death-rates of both actors we have a correlation of -0.18, and between the
mean energy of both actors a little bit positive correlation of 0.05.

1 Discussion

A first experiment has been realized with the version of the program named ae6-2-6-main.py.

This program offers the following options for the user:
1. Which kind of behavior (fixed-rule, random-rule)
2. Size of grid (n x n)
3. Percentage of obstacles in the grid (default is 20)
4. Percentage of food in the grid (default is 5)
5. Amount of cycles for one run
6. Amount of repetitions of runs
7. Debug mode (clicking with the mouse after every step) or not
8. Duration of sleeping between steps (if no debug mode)(0 – 5 sec)
9. Manual or random determination of start position

The output is a graph showing the mean energy consumed, the death
rate per run, the percentage of energy level per run, the percentage of
obstacles and food to the grid area.

All these options of the program have been tested. Everything worked
fine. Only in the complete automatic mode (with automatic start positions)
the program crashed with spyder in the case of the random rule actor.
Repeating these tests directly from the Linux-Shell with the directory
path ’ /Dokumente/EMP/SW/PY-PROGRAMS/A-E-6-2$’ and the command ’python3 ae6-2-6-main.py’ everything worked fine. No problems. Thus it seems that the error is an artifact caused by the spyder-software.

1.1 Expectations

In this experiment the following options have been activated:

1. Either behavior type 1 or 2
2. Using the grid sizes 7 – 9 – 11 – 15
3. In parallel using the amount of cycles with 50 – 70 – 90 – 130
4. In all cases 10 repetitions
5. No-Debug, Sleep-time 0 sec, automatic determination of start position.
6. For every type of behaviour with a certain amount of cycles the experiment has been done 3 times.

With these assumptions does the abbreviation ’T1-7-50-10-R1’ mean
that this experiment used type 1 of behaviour, grid-size was 7×7, amount of cycles was 50 with 10 repetitions, and this was experiment 1 of three.

In case of the fixed-rule actor the amount of the death-rate depends directly from the fact, that the right-hand rule allows a path, where there is no single food object. The size of the grid and the percentage of objects and food does not matter. The only influence can be that the positive paths can have until 4 food interactions; this can increase the amount of mean energy.

In the case of the random-rule actor the death-rate depends from the
fact, that a random path is completely open. Even if a random actor hits
lots of food-objects this does not guarantee a death-free path. The only
influence can be that the length of the path increases the probability to hit
a food object.

1.2 Results

The results show, that there is no clear correlation between the mean
amount of energy and the death rate of an actor (-0.78 fixed rule Actor),
(-0.71 random rule actor). This confirms the expectation above.
Between the death rates of both actors we have a correlation of -0.18,
and between the mean energy of both actors a little bit positive correlation
of 0.05. That there are slight correlations between the death-rates of both
actors and even more between the mean energies is also confirming the
expectations. Because both actors depend from the same configuration
and where the proportion between objects and food is stable with regard
to the whole grid it is only the length of the path which varies, and this can
increase the amount of energy while the death-rate keeps its uncertainty.

 

1.3 Consequences

This simple setting demonstrates that an input output system whose only
interactions with the environment are fixed or random movements which occur independent of the actual context as well as interaction with food when the actor hits the food directly is highly uncertain in its overall outcome.

To improve the success of an actor one has to provide some kind of an
internal representation of the environment inside the actor in a way which
allows an exploitation of those properties of the environment which support more success in terms of energy and low death-rates.

Another dimension could be the generation of offspring under certain
successful runs. Offspring would generate some kind of a population which
implies new kinds of constraints.

DATA

For the data sets read the attached PDF.

PROGRAMMING WITH PYTHON. Milestone 0. Actor-Environment Baseline

emerging-mind lab (EML)
eJournal ISSN 2567-6466
29.Nov. 2017
info@emerging-mind.org
Author: Gerd Doeben-Henisch
EMail: gerd@doeben-henisch.de
FRA-UAS – Frankfurt University of Applied Sciences
INM – Institute for New Media (Frankfurt, Germany)

ZIP-FOLDER

SUMMARY

This small software package is a further step in the exercise to learn python3 while trying to solve a given theoretical problem. The logic behind this software can be described as follows:

  1. This software shall be an illustration to a simple case study from the uffmm.org site. The text of the case study is not yet finished, and this software will be extended further in the next weeks/ months…
  2. The base-version of this software offers the user a menu-driven start to define  a simple test-environment where he can investigate the behaviour of (yet) simple actors. At the end of a test run (every run can have n-many cycles, there can be m-many repetitions of a run) a simple graphic shows the summarized results.
  3. The actual actors are without any kind of perception, no memory, no computational intelligence, they are completely driven either by a fixed rule or by chance. But they are consuming energy which decreases during time and they will ‘die’ if they can not find new energy.
  4. A more extended description of the software will follow apart from the case study as well as within the case study.
  5. The immediate next extensions will be examples of simple sensory models (smelling, tasting, touching, hearing, and viewing). Based on this   some exercises will follow with simple memory structures, simple model-building capabilities, simple language constructs, making music, painting pictures, do some arithmetic. For this the scenario has to be extended that there are at least three actors.
  6. By the way, the main motivation for doing this is philosophy of science: exercising the construction of an emerging-mind where all used parts and methods are know. Real Intelligence can never be described by its parts only; it is an implicit function, which makes the ‘whole’ different  to the so-called ‘parts’. As an side-effect there can be lots of interesting applications helping humans to become better humans 🙂 But, because we are free-acting systems, we can turn everything in ins opposite, turning  something good into ‘evil’…

PROGRAMMING WITH PYTHON ubuntu 14, Windows10, ubuntu 16. Build the Environment. Part 2

emerging-mind lab (EML)
eJournal ISSN 2567-6466
31.Oct – 2.Nov 2017
info@emerging-mind.org
Gerd Doeben-Henisch
gerd@doeben-henisch.de
FRA-UAS – Frankfurt University of Applied Sciences
INM – Institute for New Media (Frankfurt, Germany)
November 2, 2017

Contents

1 Why an Update (of ubuntu 14.04)? 2
2 Download And Install Ubuntu 14.04 3
3 Prepare The SW Environment 3
4 Terminal, Packet-Manager ’Synaptic’ 4
5 Manage Programs 5
6 Type Setting with TEXStudio 5
7 File-manager ’Krusader’ 6
8 Open Office Suite (e.g. for Drawing) 6
9 Simple Editor ’gedit’ 8
10 Screen-shots with ’shutter’ 8
11 Image Post-Processing with ’gimp’ 8
12 Python2+3, spyder3
13 Recording with the ’simplescreenrecorder’ 10
14 Video-Streamer ’vlc’ 11
15 Speech Synthesis with ’espeak’ and ’pyttsx’ 11
16 Ubuntu 14 and Windows 10 as Environment for Python3 12
17 Opting for ubuntu 16.04 besides ubuntu 14.04 12
18 Rebuild the Environment with ubuntu 16.04 13

OVERVIEW

The original plan was, to set up under ubuntu 14.04 a program-
ming environment which can use python3, spyder3 and as additional
software a speech-synthesis software like pyttsx. While everything
worked fine (see the first part of this article), it came to a ’show down’ when trying to combine python3 under ubuntu 14.04 with spyder3 and pyttsx3. All trials to overcome the problem led to new problems (see below). Finally I decided to give up the axiom of having ubuntu 14.04 on account of ros (robot operating system), because the primary tool is in this phase the programming language python. Python offers a ’universe of concepts’ on its own. And, who knows, there will be a day where ros will work with ubuntu 16.04 too :-). Then I installed ubuntu 16.04 (as upgrade from the internet) and checked the combination of python3, spyder3 and pyttsx3. It worked.

The pages 1-15 of the article describe a first update still using
ubuntu 14.04. Then it came to the crash when trying to combine python3 + spyder3 + pyttsx3. This led to the upgrade to ubuntu 16.04 and the new story. Before it came to the upgrade there was an important interaction with windows 10 helping to understand some limits and possibilities.

For more Details see:

PROGRAMMING WITH PYTHON ON UBUNTU. Part 1. Build the Environment

eJournal emerging-mind lab (EML)
ISSN 2567-6466
info@emerging-mind.org
Author: Gerd Doeben-Henisch
gerd@doeben-henisch.de

Abstract

After the description of how to use the python programming language under windows 10 starting from scratch in 6 posts we start here with some more posts dedicated to the question how to start programming
with python under linux using the distribution ubuntu 14.04. This distribution is selected because we will use later the ros (robotic operating system) as well as the tensorflow library.

Keywords: ubuntu 14.04, python 2, python 3, spyder

See for the details:

PDF

With a commenting Video