How to write Simple Binary Genetic Algorithm in Haskell

Haskell is a purely functional programming language.I have used Haskell to write a simple Binary Genetic Algorithm.Genetic algorithm is optimisation and search technique based on principles of genetics and natural selection.The steps I followed for Binary Genetic Algorithm are :

  1. Define cost function, cost, variables.
  2. Select GA parameters.
  3. Generate initial population.
  4. Decode chromosomes.
  5. Find cost for each chromosome.
  6. Select mates for reproduction.
  7. Mating.
  8. Mutation.
  9. Check stopping criteria
    • IF (reached max number of iterations OR
    converged) THEN stop
    • ELSE go to Step 4.

I have upload the Haskell Script with this post below.

Binary Genetic Algorithm Hello World Haskell

Binary Genetic Algorithm Hello World Haskell

The algorithm works pretty well for “Hello World”. Only last three guess is wrong. Now lets give complex target

Binary Genetic Algorithm Example Haskell

 

The algorithm works well for complex combination of characters also. You can try the different target combination changing in SimpleBinaryGA.hs

Click Here to download Source Code

Credit:Robin Bye

International Student Experience living in Norway

My name is Bikram Kawan, and I came to Norway crossing approximately 4,000 miles, from Nepal. Currently, I am a student of Simulation and Visualization. At the end of my Bachelor in Nepal, I thought of taking my Master degree abroad. Norway was the only country, which fascinated me; educational standard, social life and technology combined. The next additional motivation for applying Norway is from the recommendation of my former teacher who studied in Norway himself. I never wanted to halt my education, and wanted to restart further my education in Norway as soon as possible. I finished all the necessary requirements to be an eligible applicant. It was the month of November-December of 2011, deep winter running in my hometown, when I warmed myself rushing to places, making my application successful. I applied in a couple of universities in courses like Network and System Administration, Control System and Computer Engineering. I was offered from the Høgskolen i Telemark, Master in System and Control Engineering. The syllabus is very interesting and so I set up my mind to choose the course. After spending several months of hard time in Nepal for several steps for proceeding further, I finally landed in Norway in August 2012 at midnight. The first week was quite difficult to adjust, perhaps due to the new weather. The most remarkable thing I could notice was the sun till night (which I loved a lot).

nepal to norway

I moved to Ålesund in the first week of August last year. I found this city much more beautiful than Porsgrunn with huge potential for internal as well as international tourists. I went hiking on Trollstigen a week before the school started which was very adventurous and was full of new experience for me.

 Åndalsnes - HikingThe opening day of the school was very informative with lots of information held on the main block. The lectures were mainly focused on the department, city and other general stuff. I loved the translator idea for converting Norwegian to English. There were so many Fadder helping new students like us, so I never felt uncomfortable in this new school. They were helpful and guiding almost all students from A to Z. The first week was full of different activities managed by Fadder, such as games, karaoke, quiz, boating, and a lot more. Through this event, we managed to make new friends from different countries. The teamwork of Fadder was outstanding.

 Fadder Festivalen 2014

Fadder Festival 2014

The teaching methodology so far is good. All the professors are very friendly. They let us feel like friends, rather than our teachers. When we were stuck in any problem, they never got tired of motivating us to solve the problem. They even stayed with us until the late evening, the assistance which I barely found in other places. This is what I love about the teaching methodology in the school. The administration and student service also give advises when we are in confusion on something. Sometimes, the school or student unions organize career fairs, which are extremely important for students to know more about the local and multinational companies. I think this kind of fairs will add motivation for students and if you are the right candidate, you can get real industrial experience. Since I am a student of Simulation and Visualization, once we were taken to have a look of Rolls-Royce Simulator. The expectation after finishing the course increased a lot after I had a chance to feel the real simulation of vessel. I must say that the resources of the school such as the library, the internet and other stuff are also excellent. Students can access almost 24 hours of library and internet, which is a great plus point for students who want to study in the library.

The living expense is quite expensive. I found students who have come from other European countries also felt the same like me. However, it is good that there are many English-speaking countries who hire students for weekend or part-time jobs. Definitely, this will make students hardworking and help them financially during their study.

Career Fair 2014 AAlesund

Career Fair in School

Ålesund is undoubtedly one of the beautiful and economically important cities of Norway. The weather is very pleasant in summer, which is perfect to explore this beautiful city. However, I must say that during the winter (right now), it is unpredictable and harsh. It is very hard when there is the storm. We can see the fantastic northern lights from Sentrum. In addition, it has a lot diversity of people from different parts of the world. In general, I found almost all Norwegians very polite, friendly and helpful. They speak English very fluently and never felt bad communicating in English, so it is very quite easy for us to communicate. This makes international students’ life easier while staying here. I found that people are very really practical and very progressive. The best part is that they are happy to stay informal. Another important feeling of mine towards Norway is that I feel very safe living here which one cannot find in other country. Norway is the second most expensive country as per the recent statistics. However, one can see and realize why it makes other countries left behind in regard to the living standard.

In general, studying in Ålesund, Norway so far is really has been a life-time experience. During your stay in Norway, we experienced many beautiful fjords, best hiking routes, northern lights and numerous lakes. If you are really interested to build your career in Maritime, I highly recommend you to join Høgskolen i Ålesund to share your skills and ideas with experienced professors. At the time of writing this, I am very overwhelmed by the Norwegian people and their culture. I have heartful of respect and love to you all for being so friendly and making me feels like living in my own home country.

 Aalesund

How to use Greenfoot Projects within Eclipse

“How to import Greenfoot Project with in Eclipse ? ” This was my assignment task for the Distributed Programming. Greenfoot is especially design to make simple game using Java libraries.The main purpose of importing Greenfoot into Eclipse to integrate the some features of Eclipse while making games in Greenfoot. The steps are very easy as follows.

1. Fire up Eclipse and create new project or locate your existing Greenfoot directory.

2. After locating my greenfoot project “Rollball” , the directory structure looks like this.

Greenfoot in Eclipse

3. Right click the JRE System Library and select Build Path >>Configure Build Path..

 

JRE System Build Settings

4.Choose Add External JARs and find the bluejcore.jar (C:\Program Files (x86)\Greenfoot\lib\bluejcore.jar) and greenfoot.jar (C:\Program Files (x86)\Greenfoot\lib\extensions\greenfoot.jar) and click ok.

5. There will come Referenced Libraries in which the just imported Jar will reside.

6.Create a new file at the root of the project as in picture above with name “standalone.properties”. Now copy and paste  the below code.

    project.name=Rollball
main.class=myworld
scenario.lock=false

Rollball is the name of your greenfoot project. myworld is the name of my world created in greenfoot.

7.Its time to fix the image location. Open “project.greenfoot” in text editor option find the name of your image used for actors and change the image location.

For Example : class.Rabbit.image=images/Rabbit_small.png.

8. Right the folder and choose Run as application.

If You are interested Try my simple Game built on Greenfoot.

https://db.tt/dWoU7fx6

List of Norwegian Universities / University Colleges For Master Study

Previously ,I wrote the article on How can you apply for the master program in Norway by yourself without consultancy. Now I thought to give the list of Norwegian Universities and University Colleges (State university) which offer Master program in different faculty for free tuition fee.

I have prepare the list in which you can download from here.

After you are interested in subject from any university , you need to apply online. Generally online applications should be applied from Soknadsweb (https://fsweb.no/soknadsweb/velgInstitusjon.seam) .Then you will see a drop down menu from where you can select your desired university. Some colleges are not included in this list. If the college which you want to apply is not listed in drop down menu , Just Google for that. For example NMBU is not listed. Keyword ” NMBU Soknadsweb “.

You can start applying from the beginning of November.

Links:

List of university / University Colleges of Norway for Master

Read the article on How to apply for Master program in Norway.

Sample of Motivation Letter

Comments/ Suggestion are welcome.

 

[Solved] Write to text files with c# in Unity3D using StreamWriter

StreamWriter is very simple tool which let you to write your data into text files.This script is very easy to understand and working method which I have implemented in my Foxes and Rabbit Simulation.Unity3D C#

using UnityEngine;
using System.Collections;
using System.IO;

public class countfox : MonoBehaviour {
public int count_fox;
StreamWriter sw;
GameObject [] fox;

void Start(){
sw = new StreamWriter(“count_fox.txt”);   //The file is created or Overwritten outside the Assests Folder.
}

void Update(){

fox = GameObject.FindGameObjectsWithTag(“fox”);
count_fox= fox.Length;

sw.WriteLine(” ” + count_fox+” “+System.DateTime.Now, true);

sw.Flush();

}

}