Giter VIP home page Giter VIP logo

cdr-generator's Introduction

CDR generator

The goal is to generate CDR based on different model and to allow model "mix in".
To achieve that, the generation of the CDR is break down in differents generals steps and for each steps, there are multiple implementations which respect a common interface. This implies that we can use any implementation for a step very easily.

Generation Steps

  • Generate the cells
  • Generate the operator
  • Generate the users (operators, cells, schedule, wallet,...)
  • Generate the social network
  • finally with all those informations use a simulator to simulate one day There are multiple simulators possible
    • Iterate over the social graph
    • Go through each id and generate the cdr's according to some distributions
    • Go through each edge of the social graph and generate random cdr for the edge ( BasicSimulator )
    • ...

Usage

To use the generator you must choose the generators you want for each step and build a Simulator with those generators. Then you just need to call simulate on the simulator to generate the CDR.

	val simulator = new BasicSimulator(
		new BasicCellsGenerator(10),
		new HarcodedOperatorsGenerator(),
		new BasicUsersGenerator(50),
		new RandomSocialNetworkGenerator()
		)
	simulator.simulate(new DateTime).map(_.toString).saveAsTextFile("test.csv")

To compile and run the test :

sbt "~test-quick"

To run :

sbt run

To generate the scala doc (in target scala-../api) :

sbt doc

Existing implementation step

CellsGenerator :

  • BasicCellsGenerator : Generate cells randomly in "square".

OperatorsGenerator:

  • HardcodedOperatorsGenerator : Generate 2 hardcoded operators.

UsersGenerator :

  • BasicUsersGenerator : Generate DumUsers which call from only one cell

SocialNetworkGenerator:

  • RandomSocialNetworkGenerator : Generate a social network based on the logNormalGraph generator the graphx (generate a graph for witch each user has a random (logNormal distribution) number of edges.

Simulator :

  • BasicSimulator : Generate cdr in one pass over the edges of the social graph

Structure :

Source structure :

Generator/
	- Operator
	- Cells
	- Users 
    - Schedule
	- Market
	- Social network
Simulator/
IO/
Model/
Config
Main

#Next ? ##Streaming mode: ###Idea 1: Use a social graph and :

  • for each minute compute for each user the call and sms that they will made during this minute.
  • Update the graph to ensure that there are no one who make 2 phone call simultaneously
  • Then collect all the cdr's
  • Each second send to the application the cdr's for the second

cdr-generator's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cdr-generator's Issues

Setting up and Using cdr-generator

Hello,
i am new to big data and a student of computer science in need to to test out learn big data algorithms, i need a guide on how to setup and use cdr-generator the read-me didn't provide me with much helpful pointers on how to setup (what libaries are requires) on linux or mac or windows and use.
do i need to program it with scala or apache sparks. thanks for your timely response

Headers and date format of the data generated

Hi @FHachez

Really nice work!l

I'm not sure about what data I've generated with "run.sh"

Checking CDR.scala, looks like the fields of the CDR are:

/** Represent a CDR
 * @param fromUser          User who call/SMS
 * @param toUser            User who recieve the call/SMS
 * @param fromCell          The cell from which fromUser call/SMS
 * @param toCell            The cell from which toUser call/SMS
 * @param date              The date of the call/SMS
 * @param duration          Duration of the call/SMS
 * @param cdrType           Call/SMS
 * @param fromTerminationStatus How the call/SMS terminated (from)
 * @param toTerminationStatus How the call/SMS terminated (to)
 * @param fromValue             Cost of the caller
 * @param toValue             Cost of the reciever
 * @param transitType       OnNet/OffNet call/SMS
 * @param fromTac               Device TAC of the caller
 * @param toTac               Device TAC of the receiver

But If I check my lines, i get:

35824005,1,4,operator 1,1.8551115581206334,ONNET,4,35824005,operator 1,1,8.489751528509409,1,0,%2019%37%29%4%33,1,SMS
35824005,1,4,operator 1,3.039001463021207,OFFNET,4,35824005,operator 1,1,7.220981162300367,1,39,%2019%37%29%1%53,1,call
35824005,1,4,operator 1,7.5051411635733025,INT,4,01241700,operator 1,1,5.11695678948267,1,0,%2019%37%29%9%39,1,SMS

Which I think they are the same fields but in other order.

¿Where can I find the headers of the data? ¿Can you identify every field in my lines?

Besides, I have a problem with the format of the date:

%2019%37%29%1%53

I cannot figure the format of that string...

--

regards!

Daniel.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.