Agent Based Coalition Bargaining Model on Python - python-3.x

I am trying to run some simulation on Python for a social network in which agents play a coalition bargaining game. Which package is the most suitable for my needs? Are there examples that I could use when constructing my own code?

The documentation for mesa is a good place to start. Also their GitHub has a solid number of examples that you can pull from. I have found that the developers of Mesa are super responsive to their GitHub issues as well (almost always responding within a matter of hours) so that has been helpful to me as I've found things that needed fixing in the tutorials.
I have also found it helpful to go off of some of the example models included in NetLogo when you install it (see https://ccl.northwestern.edu/netlogo/models/). It is not in Python of course, but it is helpful to see how they set it up and is relatively easy to implement their ideas in python with mesa.
In regards to which package would be most suitable, I think it would depend on how large of a simulation you are hoping to run. Mesa has been good for smaller/medium scale simulations, but if you are hoping to run something huge you may need to look elsewhere.

Related

Anjuta/Glade Tutorials or Better IDE?

I am attempting to develop a GUI application for Tails. I'm doing the initial development on Debian 8 since development directly in Tails can be a pain.
I started out using Anjuta, but the documentation is essentially non-existent. The Anjuta website has nothing at all about how Glade is integrated or how to use it. I can't even track down documentation on how to change the main window title. The only tutorial I found has you start a project and build it using the default files that are generated for a GTKmm project.
Is there a good book or online tutorial out there for doing GUI development in Anjuta?
This is maybe not a complete answer, but it's too large to put in as a comment. I use Anjuta fairly regularly, but I share your feeling about the missing documentation (which is, by the way, not unique for Anjuta). I appreciate Anjuta (and Glade) very much, so don't take the following as criticisms on either program.
I would recommend you consider using PyGTK for GUI creation. It is a lot more productive. You can design the GUI in Glade - exactly the same way you would do for C/C++ - and then implement the code in Python, which you can also edit and manage from Anjuta. There are plenty of code examples, for example on the nullege code search engine.
About the work flow in Anjuta (for C/C++). It is based mainly on the Autotools system, so you should really read up a little on make, Makefile, and related tools. Though in principle Anjuta manages this, you will, sooner or later hit a problem, and some knowledge about Autotools will help you a long way (also this tutorial or this one. This slide series is interesting - probably because it is more graphical. There are even some video tutorials, like this one.).
There is no real necessity to use Glade from inside Anjuta. In fact, Glade has passed a long process distancing itself from 'code generation'. It now only contains an XML generator, which can be called separately. I find the screen space left for Glade inside Anjuta insufficient for comfortable work anyway.
So, in conclusion: If you mainly need a GUI, consider Python + Gtk. If you do need C or C++, Anjuta is a great IDE, but look at Gtk Development examples (like this one). Following those, the use of Anjuta should be a lot clearer.
EDIT:
Very useful answer. I have some underlying legacy code that has to be
C++. Is there a way to mix Python and C++ in Anjuta, or do you know of
any guideposts or tutorials for such?
You can open a C++ project in Anjuta - maybe even import you legacy code directly as a Makefile project. You can also add new files to your C/C++ project and create them as Python files. I've never tried to do that though, and I'm not sure how Anjuta would treat them, for example, in the Makefile(s). I don't have large projects mixing languages at the moment, but for small projects, I like 'Geany', because it doesn't get in the way. You do have to maintain the Makefiles manually.

High-level level language for image processing

My final year project group is planning to build a real time application with neural network support and need to handle image processing efficiently, Any language suggestions would be very much helpful. Thanks.
Mathematica may offer some useful features. The last couple of releases have added quite a lot of image processing functionality. You can get a taste by looking at these blog entries:
How to Make a Webcam Intruder Alarm with Mathematica
The Battle of the Marlborough Maze at Blenheim Palace Continues
The Incredible Convenience of Mathematica Image Processing
Mathematica is an interpreted language, which would appear to present an obstacle to your real-time constraints. However, Mathematica has always integrated well will foreign code (notably C, Java and .NET) and the latest release adds considerable new capabilities with respect to C-code generation, dynamic-library loading and CUDA / OpenCL GPU programming.
Alas, Mathematica is not FOSS and is pretty expensive for commercial use. However, they give great student discounts (90%+, last time I checked) and some college/university departments have site licenses.
On the down side, the Mathematica language is quite unconventional and it takes time to get into the swing of things. IMO, the effort is worth it, but the learning curve might be too long if your project timelines are short.
Note: I am not affiliated with WRI in any way.
My suggestion is OpenCV and C++. OpenCV is also usable with Python, but I don't recommend it if you need to write fast code, Python can be really slow.
How about Python? There is PIL, which
adds image processing capabilities to your Python interpreter. This library supports many file formats, and provides powerful image processing and graphics capabilities.
An introductory article about NN with python and a feed forward NN library:
http://www.ibm.com/developerworks/library/l-neurnet/
http://pypi.python.org/pypi/ffnet/0.6
Matlab provides a lot of features for image processing. May be slightly slow, but I assume performance is not an issue.
ImageMagick is suppose to be real good, but I have no first-hand experience. Mathematica?

How do I start contributing to GNOME?

How do I start contributing to GNOME? I can program in C++ and Python, but have never touched C. I am not familiar with GTK even.
To be honest, I have no idea how GNOME works. All I have is a deep desire to somehow contribute to it.
Where do you recommend do I start? Any tutorial, mailing list or anything. I am ready to do the hard work, I just need a direction.
PS: I could have googled for the problem, but nothing beats the experience I have seen since Google returns SO for most of the questions.
Visit Join GNOME.
Figure out what you want to do for them
If it's development, then:
learn C and GTK
checkout the source code
browse through the bug-tracker to find a reasonably sized task and ask for help of more senior committers to tell you what is at your level
fix it and submit a patch
wait for roses and glory
But maybe you can help with other things, as mentioned on Join GNOME
Translations
Design / Artworks
Technical Documentation (review, proofreading)
Best of luck and thank you for trying to contribute.
Be sure to check out GNOME Love as well. It's a site aimed at getting people started with GNOME.
You may find it handy and useful by creating new extensions for Gnome shell.
There are a lot of extensions on https://extensions.gnome.org/. It requires JavaScript programming. It will also give you insights of how things work in Gnome.
start simple program with below manual.
The GTK+ tutorial
GTK+ 2 Reference Manual
GTK+ 3 Reference Manual
show your program here: http://www.gtkforums.com/ (Project Showcase)
also to note:
you don't have to learn C (even though it's a good idea). You can use PyGtk for GTK development in python (but i won't recommend that because of the speed of python).
GTK bindings for c++ also exit it's called gtkmm. It have binding for many other librays (Cluttermm, Cairomm, Pangomm).
there are bindings for A LOT of languages but native C is the best solution.
I would recommend learning vala because of it's ease of use but also because of it's speed (but that's just personal preference).
also check the gnome-devel-demo out. can be useful

Image process & recognition implementation on Linux. How to?

Usually I develop image processing or recognition programs on windows. But I got a customer who requires me to implement one on Linux platform.
Because his platform is embedded system, I don't know for sure that OpenCV would be available. Could anyone give me some clue to get started?
You can package OpenCV with your application.
The word 'embedded' makes me nervous - image recognition can be very computationally expensive. You may need to roll your own code to fit the target constraints.
The starting point of your own code is likely to implement a Haar-like recogniser.
This is of course what you'd likely be using OpenCV to do. A more ambitious recogniser is HOG. Here's a nice comparison of them.
OpenCV is in standard repositories for Ubuntu and/or Debian Linux. As such it should run on many processors including ARM. If it runs a full Debian, it is a matter of apt-cache search opencv, then install the modules you want via apt-get install.
The big gotcha is the embedded part. If it doesn't run a full Linux, then you may end up compiling for a very long time. Cross your fingers it runs a full Linux (like Debian.)
Adaboost should be a good fit for use as a learning algorithm. Paul Viola and Michael Jones have an interesting paper on efficient face detection using Adaboost and Haar classifiers. There's a lot of math there, but it's worth reading.

Contributing to a Linux distribution

I'm interested in contributing to a Linux distro, but regarding the various distro's developer communities, I'm having a bit of trouble figuring out which one I'd most like to join.
What languages I know: C, C++, Lua, Python, and fairly familiar with Perl (though I wouldn't say I "know" it). In particular, I have very little experience with x86 assembly besides hacking stuff together for performance tweaks, though that will be partially rectified soon.
What I'm looking for: A community that provides plenty of opportunities for developers to work on various aspects of the distribution. To be honest I'm most interested in reading and working on the kernel source (in which case the distro doesn't matter), but it's pretty daunting and I figure getting into the Linux community and working with experienced Linux developers might give me a better idea of how to jump into the guts(let me know if this is bogus, or if you have any advice regarding that).
So...
Which distro has the "best" developer community in terms of organization, people who are fun to work with, and opportunities to contribute?
I've read various "Contributing to XXX" pages and mailing lists for distros like Ubuntu, OpenSuse, Fedora, etc. but I'd rather get a more personal testament from an actual developer.
Unless you have a specific desire to learn the ins and outs of various packaging formats you would probably be better off contributing directly upstream to applications/libraries that you find interesting. While individual distributions often have a few management applications that are unique(ish) to them most core applications and libraries are shared between them.
As you have expressed an interest in guts it would make sense to stick to one of the main community distros (Fedora and Ubuntu/Debian) as the rest tend to be variations on a base distro. The other option is to choose a source based distribution which have a number of advantages to developers although you may find yourself spending a bit of time keeping your machine trim.
As I'm a developer I personally use Gentoo which gives me a number of things:
Rolling release: New versions of applications are generally available soon after release
Stable/Unstable mix: I can run stable core with bleeding edge on upstream packages I care about
Development ready: Any installed package is by default a "dev" package, the distinction between buildtime/runtime dependencies is blurred
Packaging is easy: If it's a simple as "configure/make/make install" writing and ebuild is very easy.
Contribution is easy: Contributing new ebuilds is fairly painless, from there you can get as involved as you like
Of course there are downsides, not least of all your machine spends a considerable amount of time building things and if your run a large selection of "unstable" packages you may find you occasionally need to fix-up your machine. However I find these disadvantages minor compared to giving me an up to date platform with which to contribute to upstream from.
If you want to work with the kernel then you shouldn't be picking a distribution, but rather working upstream.
Somebody correct me if I'm wrong, but I think that contributing to Ubuntu can be very easy and fun if you use Launchpad. I haven't tried contributing code, but I contribute translations and file bugs on some projects.

Resources