Class: Customers - creechD/DealershipSimulation GitHub Wiki
Overview
Customers are the lifeblood of the dealership, without customers the dealership will not sell and vehicles. Each customer has their own preferences and limits; some want large SUVs, while others are looking for an electric car, it is the salesperson's job to discover what the customer actually wants and to get the most money out of them. Sometimes, customers come in looking for a vehicle that is outside of their price range and it's the salesperson's job to get them into a vehicle they actually want.
Attributes
preferred_sp
Sometimes customers already have a salesperson in mind before going to the dealership (either from word of mouth or from prior experience). (word of mouth can be from a prior customer getting a great deal on a vehicle and then telling their friends)
engaged_sp
This indicates whether or not the customer is engaged with a salesperson. Salespeople will try to engage customers that are not currently engaged with someone else, i.e. a salesperson isn't going to steal a customer from another salesperson.
near_by_sp
While the customer is shopping, this tracks whether or not a salesperson has walked over to "find out if they need any help". A "near by" salesperson that is not engaged with another customer is required for the customer to change states from shopping
into engaged
.
actions_per_second
This is how many times the customer can preform actions each second.
last_action_time
This tracks how long it has been since the last action was preformed.
entered_store
This is the time on the game clock when the customer entered the store.
timeLimit
This is how many game seconds the customer can stand being in the store. TODO: Make transitioning between states effect this variable, e.g. when a salesperson engages with the customer, that could add time.
###Future Attributes to Code These are ideas for customer attributes that should be added.
budget
and budget_sd
This is how much money the customer expects to pay and it's standard deviation (sd). The SD is included so that it can be harder to get the customer to agree on a higher price.
interested_vehicles
This would be an order set of vehicles that the customer is interested in purchasing.
initial_vehicle
This is the vehicle that the customer comes into the dealership wanting to purchase. (I wonder if a vehicle class could be created to be shared between these interested vehicles and inventory...)
States
States govern what the customer can currently do.
###State Progression This is the sequence and requirements for going between states. It also includes which states each state can go to.
###Idle The customer is standing around the store determining whether or not to leave.
Goes to:
- Shopping - Criteria: Random chance (50%)
- Left - Criteria: Failed Shopping check and when the customer is over their
timeLimit
###Shopping The customer is actively looking at cars, ready for a salesperson to engage them.
Goes to:
- Idle - Criteria: Random chance (20%)
- Engaged - Criteria: Random chance (40%) and if a salesperson is near by. The random chance is increased to 60% if the customer's preferred salesman is the one near by.
###Engaged The customer is engaged with a salesperson starting to talk about what kind of vehicle they are interested in. A good salesperson will bring the customer over to their desk to talk more about the car that the customer is looking for.
###Left The customer has left the store. Eventually, customers that have left the store should be able to come back in (through something like an email from a salesperson). That system, managing and generating leads, needs to be developed.