SocialSim

Welcome to the SocialSim opinion dynamics simulator page

cs.upt.ro/~alext/socialsim

The social simulator, SocialSim, as a custom built software product, enables the simulation of many scenarios with custom topology, interaction model, network size, agent positioning etc. Apart from implementing already known models in literature, the simulator also includes a more complex opinion interaction model referred to as the tolerance based model.

The name of our tool derives from the words social (network) and simulator. SocialSim is developed as a universal tool for network simulation, as it offers great flexibility and extensibility due to its design. The system is based on a self-made framework which offers UI support and multithreading support. This framework was developed with the idea that it should be usable by any application with a user interface. SocialSim offers users the ability to setup a social network simulation and view the real time development of that network. All results can also be stored into log files. The result output is done with graphical means as well as in human-readable text format.

The importance of this tool is even greater as most articles in the field of Social Networks Analysis (SNA) only present theoretical research with no available proposed simulators or simulated results. This type of approach, although more rigorous than software simulation, can only offer answers for small scale setups – small networks, few links, few variables. The problem with this approach is that the effects of complex interaction models cannot be determined mathematically (or, is considered to be very hard). Additionally, the impact of the size of a network is mostly unknown. Such studies have not been carried out because of the difficulty of mathematical computations.

Technical aspects

SocialSim is a tool developed in Java. The programming language was used because of the world-wide popularity among developers, the available libraries and because of the multi-platform and multi-OS functionality. As many researchers and students use Unix-based operating systems (e.g. Linux, Debian, Mac OS), but the popularity of Windows is undeniable, it was important to start the development of SocialSim in a language that is not operating system dependent. The small differences are negligible and the UI is configured to maintain the same look and feel. The input and output also do not depend on any OS file system implementation. While thread management is different form one operating system to another, the java virtual machine (JVM) ensures a uniform implementation across all platforms.

The available libraries for the Java language are a good argument for its usage as the backbone of SocialSim. The most notable libraries used are:

  • Java AWT (Abstract Window Toolkit): the platform-independent toolkit for widgets, windows and graphics. It is available in the java.awt package, present in the Java Foundation Classes and is distributed with every basic java virtual machine. It also implements UI events processing used to keep track of the user’s mouse and keyboard actions.

  • Java Swing: is a second generation widget toolkit. Part of the Oracle Java Foundation Classes, it is a more sophisticated version than AWT. The toolkit is available in any java standard edition and can be found in the javax.swing package.

  • Concurrency: Java offers support for concurrent programming with the basic Thread class and Runnable interface. Java offers developers the capability of multitasking and multithreading.

  • Utility: Java offers a great deal of utility classes for storing lists, ordering, sorting, encrypting, managing various text formats, measuring elapsed process time, using calendar information etc.

By combining these basic packages, a basic framework was developed. This framework can be used to develop any desktop windowed application with customizable complex widgets, basic input-output, multithreading support and user event processing.

A last reason, but equally important, for the decision to use Java is that it is a very popular programming language. Together with C/C++ and Visual Studio C#, Java is a very well documented language, full of tutorials for any type of problem, and which has always seen great popularity in major technology companies (e.g. Apple, Sun Microsystems, Oracle). The reason for why the popularity of the programming language is important is because SocialSim is destined to be open-source and extensible by any researcher or developer around the world. It is built as a tool fit for extensions, so that a popular language is of great benefit.

SocialSim was developed in the Eclipse IDE, used mainly because of personal experience and the huge amount of help it offers developers through its layout, windowing, shortcuts, debugging options and product configuration. The solution is structured as a series of plugins, which can be used independently, based on their dependence. The constructed framework used to build SocialSim upon represents a Model-View-Controller (MVC) approach. The framework encompasses the view and the controller, while the model is left to be implemented by the specific application. The plugin structure and content are depicted below. The plugins depicted below have the following roles:

  • upt.io – enables users to log results. The abstract implementation of Log.java defines the API for all implementing log formats.

  • upt.listeners – facilitates event processing. These events can come from mouse clicks, mouse movement on the screen and keys being pressed. Because event processing adds a great code overhead in java classes a method to minimize the lines of code inside primary classes was developed. Instead of classically implementing a Listener interface within a class, and filling one or two out of the necessary ten or more methods, developers can call a Listener adaptor to whom a callable method is passed. The default usage of a listener is:

      • Add the necessary listener to the widget (e.g. button.addMouseListener() )

      • Pass the necessary listener adapter from this package

      • Implement the required performUIAction method. This method may offer a mouse event or key event.

  • upt.loading – allows the developer to hook into the loading procedure of his application. The SystemLoadManager permits a series of hooks to be inserted into the application with the goal of loading necessary runtime information. During loading, a splash screen is shown to the user.

  • upt.threading – this package is oriented towards the application model, more specifically towards the application’s usage as a simulation. Two different concurrency implementations have been tested. The social network simulation is inherently concurrent as each agent independently interacts with one of its friends. Because the number of agents should not be a limiting factor in simulations, interactions are run in parallel on multiple threads to speed-up each simulation day (tick). For a number of 1000 agents, concurrency would not be needed, but configurations with 100,000 or more agents do require optimizations.

  • upt.ui – is the most complex plugin, offering developers custom made widgets, java JFrame window encapsulation, browsing through multiple configuration settings, real time graphical representation of data etc. The application is based on only one window (JFrame) which has a panel that changes its layout and content accordingly. As pictured in figure 5.7, the main window is uses a static background, visible in all instances of the application. This background (black) can be customized to highlight the currently viewed content title, display tooltips for the buttons over which the mouse hovers and display the application’s name, author, version and logo. The content area (white) is dynamically filled with the content corresponding to the user’s navigation. The area is filled with so called pages, instances of the abstract class AbstractPage which are customized in the application package. The main frame holds a chain (tree) of pages that are navigable through the next and back buttons. The next button is activated by the choices presented in each page. Finally, the package implements factories for creating dynamic buttons (ButtonFrame), labels, text boxes with error highlighting (InputFrame), toggle buttons (ToggleFrame) and panels with scrollable content (ScrollView). The currently implemented set of widgets is limited due to the needs of SocialSim. Additional common widgets like radio buttons, tree lists, track bars can also be implemented.

State of the art modeling

Relevant topologies and opinion interaction models

Usage

Screenshots

Configuration of simulation specific parameters like CPU usage, threads to be used, interval of polling the society etc.

Selection of specific SNA topologies

Setting pre-simulation parameters like network size, link density, opinion initialization, small-world initialization (long range links), number of stubborn agents (opinion sources) etc.

Simulation pane: shows the evolution of opinion, tolerance, opinion change in time.

Simulation results: network layout and opinion evolution graph.

Download SocialSim simulator

Make sure you have at least Java 6 installed and follow this link.

Citing SocialSim

Use the following BibTeX citation for the SocialSim framework:

Bibtex

@ELECTRONIC{top2014socialsim, author = {Alexandru Topirceanu and Mihai Udrescu}, month = {September}, year = {2014}, title = {{SocialSim}: A framework for opinion dynamics simulations}, url = {http://cs.upt.ro/~alext/socialsim} }