Friday, February 21, 2014

Python - a list of call-centre Agents (2)

It works!

After many test and searches - the corrected code works

and it can be tested here

What does it do?

The program creates a call-centre, by populating it with new employees (2 ways of adding them - when the object Centre is initialized, or by using the method hire() later)

Then after the object (my_ccg (My Call-Centre Grinder)) is created - it's possible to fire or hire employee and to display the staff (using the method display()).

NB : I posted a question to Codecadamy forum at

Python - a list of call-centre Agents

Coding is fun

Since my previous post on Python - I've finished the Python module on Codecademy
and now I'm practicing with an exercise of my own - trying to create a call-centre model.

The idea was to create my first class - Agent to store the call-centre employee
then to create another class - call-centre which is basically a list of agents

Then as you may notice the code isn't working, when it comes to hire or fire an agent -- because it simply can't retrieve an agent in the list.

There's more explanation as to know why in the comment

Coding is challenging

When I started this code, I had a very rough idea of implementing an agent class
- it will be in the staff or not (hired, or fired)
- it will interact with other (so far, no interaction - but maybe swap shift, or having likes/dislikes toward other agents)
- it will manage his stress level (burnout attribute)
- it will be promoted (level attribute)
- it will answer call
- it will go on break
- basically it will generate a log file of activities

At this stage, will have to implemented too - a call generator, and a shift class

But that's for later - the next class I created was the call-centre itself - thinking that it will be easy to simply organize all agents as a list within the call-centre.

I just have to figure out - if that's the best way to implement it - by finding a way to retrieve a specific agent within the list (which doesn't happen in the current code).

Or simply to change the strategy and how I currently handle the managing of the class Agents. My idea is to post a question on the codecademy forum.

In the meantime, sharpening a bit the basic Agent class is necessary - before I get into the call-centre class ..

I will keep posting my progress, I'm excited.