Reality Mining Experiment Connection Trace File

This page contains data extracted from the MIT Reality Mining experiment which I downloaded from the CRAWDAD repository. Each encounter between devices participating in the experiment is recorded  in the following format and can be used with The One Simulator Connection Mode .

121.00 CONN 63 13 up
121.00 CONN 63 15 up
121.00 CONN 63 84 up
121.00 CONN 63 20 up
123.00 CONN 63 13 down
...

Download it here.

121.00 CONN 263 313 up
Posted in ONE Simulator, Simulation, Social Data Analysis | 5 Comments

Why Eat 1 Tunnock’s Caramel Wafer When You Can Eat 8 Tunnock’s Caramel Wafers

The first paragraph of a blog post should explain exactly what it's about. It should be as concise and informative as the first sentence in a Wikipedia article and definitely not give the reader the impression what follows is nothing more than the puerile dribblings of an idiot.

So I'll start by telling you about what I'm eating right now. 8 Tunnock's (notice the apostrophe) Caramels with a Lemsip.

8 Tunnock's Caramels with a Lemsip.

8 Tunnock's Caramels with a Lemsip.

I'm feeling a bit rough with a throat that feels like its being grasped by Treebeard and swung on by 4 fat hobbits after second breakfast. My friend Steve says that zinc helps when feeling ill but all I have is a pack of 8 Tunnock's Caramels so that'll have to do.

Tunnock's Caramel Number 1: The first thing you notice about these things are how easy they are to eat. They're about the size of a Nokia 3310 but as soon as you put one in your mouth you've already melted half of it and are chewing on a mouthful of sweet sweet caramel. WHATUP SUGAR!

Tunnock's Caramel Number 2: The second wasn't as satisfying as the first, probably because of this fucking cold. The lemsip is doing it's job though and I'm feeling better already. I just don't think the chalky taste of lukewarm medicinal drink is a fine accompaniment to Uddingston's finest export.

Tunnock's Caramel Number 3: At this point I thought I'd compare the nutritional information from Tunnock's website to what's on the packet. http://www.tunnock.co.uk/carwafe-det.htm claims that each bar is 26.5 grams. Stop there. Look Tunnock, if that is your real name, you can't start lying as soon as someone clicks on your bloody website. I doubt the good people Uddingston are pleased with you going around The Internet lying to people about the weight of your chocolates.

Look at this picture. It CLEARLY shows each bar weighs a Net 30g

Look at this picture. It CLEARLY shows each bar weighs a Net 30g

Tunnock's Caramel Number 4: Wait I hear you cry. That's a net weight of 30g. Maybe it includes the packet? Well no, after further investigation we have found further discrepancy with Mr Tunnock's claims. According to the packet each bar has 134Kcal and according to the website they have 120Kcal each, referring to the 26.5 weight. FURTHER PROOF OF YOUR LIES! This throws all other claims by Mr Tunnock, such as 4 million caramel wafers placed end to end = 2,300 miles, the distance from Glasgow to Cairo into doubt. Indeed with The Internet we can prove that the distance between Glasgow and Cairo is far too great rendering it impossible to calculate! So unless Mr Tunnock believes there isn't enough energy in the universe to count all the way up to 2,300 I'm calling him a creepy, lying, emulsified bastard.

Tunnock's Caramel Number 5: Checked the ingredients again. There's lecithin but no zinc.

Tunnock's Caramel Number 6: Starting to feel the burn now. You could probably polish off 6 of these things without too much hassle. This is why you're fat.

Tunnock's Caramel Number 7: Incredibly each bar is only 5.473684210526316% of my GDA for fat. Meaning i've only eaten 38.31578947368421% of the fat I'm allowed today if you discount the butter on the salad sandwich I had for lunch. With a renewed enthusiasm i go about my task. Haters be gone.

Tunnock's Caramel Number 8: The last one goes down without too much trouble. I can see why 5,000,000 of these biscuits are made and sold every week. Probably sold to 89,285 people who each eat 8 per day. I've just eaten 1072Kcals which is about the same as 2 Big Macs but with an increased risk of diabetes.

Next week I make myself a blog award out of 8 lion bars.

Posted in whyhaveonewhenyoucanhaveeight | 1 Comment

New Simulation Scenario – Kilburn and IT buildings

After realising that the city wide simulation was too large for practical development of new protocols with The One Simulator, I've designed a simulation using the Kilburn Buidling Floorplans.

In this simulation we have 4 groups of students and 3 groups of staff. Each group has a Home, Office and Meeting Place. So we can use a slightly adapted version of the Working Day Movement model all of the staircases in the simulation have buses running up and down them.

Kilburn and IT building Model shown using OpenJUMP

Kilburn and IT building Model shown using OpenJUMP

The staff groups are called IMG, APT and Physics. The IMG group have homes in the Kilburn Building whilst APT and Physics have their homes in the IT building. Staff offices are the lecture theaters and some smaller meeting rooms.

Student homes are the lecture theatres and labs whilst their offices are smaller seminar rooms and staff offices.

Each group shares meeting places where they go for lunch or breaks. It is hoped that using this model we can quickly look for community data.

You can download this model here:

 

Posted in Manchester Map, ONE Simulator, Simulation | Leave a comment

The ONE Simulator PROPHET implementation – java.lang.IllegalArgumentException: Comparison method violates its general contract

I've noticed that my PROPHET simulations are not completing in large simulations. This also applies to Prophet v2. I think it's down to this method.

/**
 * Comparator for Message-Connection-Tuples that orders the tuples by
 * their delivery probability by the host on the other side of the
 * connection (GRTRMax)
 */
private class TupleComparator implements Comparator
    <Tuple<Message, Connection>> {
         public int compare(Tuple tuple1, Tuple tuple2) {
             // delivery probability of tuple1's message with tuple1's connection
             double p1 = ((ProphetRouter)tuple1.getValue().
                         getOtherNode(getHost()).getRouter()).getPredFor(
                         tuple1.getKey().getTo());
             // -"- tuple2...
             double p2 = ((ProphetRouter)tuple2.getValue().
                         getOtherNode(getHost()).getRouter()).getPredFor(
                         tuple2.getKey().getTo());

            // bigger probability should come first
            if (p2-p1 == 0) {
                /* equal probabilities -> let queue mode decide */
                return compareByQueueMode(tuple1.getKey(), tuple2.getKey());
            }
            else if (p2-p1 < 0) {
                return -1;
            }
            else {
                return 1;
            }
        }
    }
}

The line "return compareByQueueMode(tuple1.getKey(), tuple2.getKey());" should return 0 but sometimes the compareByQueueMode will not return 0. This should now be fixed by replacing "return compareByQueueMode(tuple1.getKey(), tuple2.getKey());" with "return 0;".

Posted in ONE Simulator, Prophet | Leave a comment

Connection Simulation For Trace files. Based on the ONE Simulator, without map and movement overheads

This mod called Connection Mode for The ONE Simulator 1.4.1 adds functionality which creates and destroys connections between hosts based on a connection trace file rather than movement patterns.  It can also be used to run simulations much faster because it does not calculate movement and has the benefit of being compatible with real data sets presented on the CRAWDAD repository.

Using Connection Mode is much faster on very large simulations. For example, I've generate connection traces like the one below using the Manchester Map and 8000 nodes using The One's ConnectivityONEReport.java report class.

86078.00 CONN 1864 1940 up
86079.00 CONN 553 562 up
86079.00 CONN 276 1864 down

These traces can then be used in Connection Mode to perform multiple runs of different Delay Tolerant routing schemes in hours rather than weeks.  This means we can optimise schemes over multiple runs and try new ideas over larger simulations.

Another design goal was to use existing code written for The ONE Simulator. Most reports and routing schemes should work with this mod, ones which take geographic location into account will not.

Reverse Engineering The ONE.

ONE simulator gives us the option Scenario.simulateConnection to disable connection simulations if we are only interested in movement modelling. However we want an option to only simulate connections and disregard movement modelling.

I've defined a new setting called Scenario.connectionsOnlyMode which, if set to true will cause The ONE to disregard movement pattern variables in the settings files and create and destroy connections specified in the connections file using the new ConnectionsFromFileInterface.java interface. In other words;

  1. If the -c flag is set at launch, connection mode is enabled.
  2. The method cacheConnections() in ConnectionSimTextUI.java reads information about when to create and destroy connections from the connections file. It will cache 100,000 connections at a time to allow massive connection files (Without caching it takes about 2GB of heap space to cache 8,000,000 connections).
  3. The connection file location is given in a scenario settings file by stating Scenario.connectionsFile = file.txt.

Connection mode has a limitation which is, we assume each host has only a single interface. This allows connection mode to cache from a single file easily and most importantly - quickly. Adding more interfaces will not be difficult in the future if needed.

Install

Copy and merge these files into The One (only tested with one-1.4.1) directory. I've tried to keep changes to existing files to a minimum, in most cases I've simply changed the visibility of a couple of variables.

Some detail of the other changes I've made are:

  1. Added a new command line flag -c which can be used instead of -b to signify connections mode. DTNSim had to be changed slightly to allow for this.
  2. Assume each device only has a single interface.
  3. Defined a new world called connectedWorld.java without a map or movement.
  4. No movement models (removed calls to moveHosts()).
  5. Changed SimScenario to read a new field called ConnectionMode.
  6. Changed SimScenario and DTNHost File to allow mmProto to be null because we don't need map or movement settings in connection mode.
  7. Created a new connection Interface called ConnectionsFromFileInterface.
  8. Just after the DTNHost objects are created, the connections file is read and the connections added to each hosts' interface.

Run The New Simulation

Use the -c flag to run the simulation without any movement operations being called. Some reminders:

  1. You must set Scenario.connectionsOnlyMode to true.
  2. DistanceDelayReport won't work with the Connected World.
  3. You must set Interface to ConnectionsFromFileInterface.
  4. You must set Scenario.connectionsFile to a file containing connections.

Here is a test scenario and small connection trace file:

Recompile and Run the simulation with the command ./one.sh -c 1 connection-test.txt You should see output on the command line which you can compare to your connections file to make sure connections are being created correctly.

You can get some real trace files for Connection Mode from here.

Posted in ONE Simulator, Simulation, Social Data Analysis | 19 Comments