Professional Documents
Culture Documents
Service File
Service File
Input:
import random
class Customer:
def __init__(self, patience_level):
self.patience_level = patience_level
def is_satisfied(self):
return self.patience_level > 0
class ServiceProvider:
def __init__(self, efficiency):
self.efficiency = efficiency
def process_request(self):
# Simulating the processing of customer request
return random.random() < self.efficiency
1
Ritu Raj Singh CSBS 2001331560021
else:
print("Service provider error. Customer is
unhappy.")
customer.patience_level = 0
else:
print("Customer has already left.")
print("\nSimulation Results:")
unsatisfied_customers = sum(1 for customer in customers if not
customer.is_satisfied())
print(f"Unsatisfied customers: {unsatisfied_customers}")
print(f"Satisfied customers: {customer_count -
unsatisfied_customers}")
# Example usage
simulate_customer_service(customer_count=5, initial_patience=3,
efficiency=0.8)
Output:
2
Ritu Raj Singh CSBS 2001331560021
Input:
import random
import queue
class Customer:
def __init__(self, name):
self.name = name
class Restaurant:
def __init__(self):
self.customers_queue = queue.Queue()
def simulate_restaurant_service(customers):
restaurant = Restaurant()
3
Ritu Raj Singh CSBS 2001331560021
restaurant.serve_food(customer)
print()
if __name__ == "__main__":
# Example usage
customer_names = ["Alice", "Bob", "Charlie", "David"]
customers = [Customer(name) for name in customer_names]
simulate_restaurant_service(customers)
Output:
4
Ritu Raj Singh CSBS 2001331560021
Input:
class SERVQUALAssessment:
def __init__(self, service_dimensions):
self.service_dimensions = service_dimensions
self.customer_expectations = {}
self.customer_perceptions = {}
def collect_customer_feedback(self):
print("Please rate the service on a scale of 1 to 5 (1:
Strongly Disagree, 5: Strongly Agree)")
self.customer_expectations[dimension] = expectation
self.customer_perceptions[dimension] = perception
def calculate_service_quality_gaps(self):
service_quality_gaps = {}
return service_quality_gaps
overall_service_quality_gap =
sum(service_quality_gaps.values()) / len(service_quality_gaps)
print(f"\nOverall Service Quality Gap:
{overall_service_quality_gap}")
if overall_service_quality_gap > 0:
5
Ritu Raj Singh CSBS 2001331560021
else:
print("The service organization is meeting customer
expectations in all dimensions.")
if __name__ == "__main__":
# Example usage
service_dimensions = ["Reliability", "Responsiveness", "Assurance",
"Empathy", "Tangibles"]
servqual_assessment = SERVQUALAssessment(service_dimensions)
Output:
6
Ritu Raj Singh CSBS 2001331560021
Input:
import random
class ServiceFailureSimulator:
def __init__(self):
self.customer_satisfaction = 5 # Initial customer satisfaction
level (on a scale of 1 to 5)
def simulate_service_failure(self):
# Simulate different service failure scenarios
failure_scenario = random.choice(["Delayed service", "Incorrect
order", "Rude behavior", "System outage"])
7
Ritu Raj Singh CSBS 2001331560021
def get_customer_satisfaction(self):
return self.customer_satisfaction
if __name__ == "__main__":
service_failure_simulator = ServiceFailureSimulator()
Output:
8
Ritu Raj Singh CSBS 2001331560021
Input:
from pulp import LpProblem, LpVariable, lpSum, LpMinimize
if __name__ == "__main__":
# Example usage
call_demand = 1000 # Number of calls per time period
cost_per_agent = 5000 # Cost of hiring one agent
capacity_per_agent = 20 # Capacity of one agent (number of calls
they can handle)
max_agents = 50 # Maximum number of agents to consider hiring
service_capacity_planning(call_demand, cost_per_agent,
capacity_per_agent, max_agents)
9
Ritu Raj Singh CSBS 2001331560021
Output:
10
Ritu Raj Singh CSBS 2001331560021
Input:
import numpy as np
import random
from deap import base, creator, tools, algorithms
11
Ritu Raj Singh CSBS 2001331560021
customer_location = CUSTOMER_LOCATIONS[customer_index - 1]
distance = ((customer_location[0] - current_location[0])**2 +
(customer_location[1] - current_location[1])**2)**0.5
if current_capacity < 0:
total_distance += 1000 # Penalize if the capacity is
exceeded
else:
total_distance += distance
return total_distance,
toolbox.register("evaluate", evaluate)
if __name__ == "__main__":
# Create the initial population
population = toolbox.population()
12
Ritu Raj Singh CSBS 2001331560021
Output:
13