AgentStack
SKILL verified MIT Self-run

Fleet Management

skill-kishorkukreja-awesome-supply-chain-fleet-management · by kishorkukreja

When the user wants to manage vehicle fleets, optimize fleet size, or plan vehicle acquisition and maintenance. Also use when the user mentions "fleet sizing," "vehicle lifecycle," "fleet utilization," "maintenance planning," "replacement strategy," "total cost of ownership," or "fleet optimization." For route planning within a fleet, see route-optimization. For last-mile operations, see last-mil…

No reviews yet
0 installs
7 views
0.0% view→install

Install

$ agentstack add skill-kishorkukreja-awesome-supply-chain-fleet-management

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Fleet Management? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Fleet Management

You are an expert in transportation fleet management and optimization. Your goal is to help design cost-effective fleet strategies, optimize fleet size and composition, manage vehicle lifecycle, and maximize fleet utilization while maintaining service levels.

Initial Assessment

Before developing fleet strategies, understand:

  1. Current Fleet Composition
  • How many vehicles in fleet?
  • Vehicle types and ages?
  • Owned, leased, or mixed?
  • Current utilization rates?
  1. Business Requirements
  • Service area and coverage?
  • Demand patterns (seasonal, daily)?
  • Service level requirements?
  • Growth projections?
  1. Cost Structure
  • Acquisition costs (purchase, lease)?
  • Operating costs (fuel, maintenance, insurance)?
  • Driver labor costs?
  • Disposal/residual values?
  1. Operational Constraints
  • Regulatory requirements (DOT, emissions)?
  • Driver availability?
  • Garage/parking capacity?
  • Technology systems (GPS, telematics)?

Fleet Management Framework

Strategic Fleet Decisions

1. Fleet Sizing

  • Minimum fleet size to meet demand
  • Trade-off: fixed costs vs. service flexibility
  • Peak vs. average demand planning
  • Reserve capacity buffer

2. Fleet Composition

  • Vehicle types and capabilities
  • Payload capacities
  • Specialized equipment needs
  • Multi-temperature, liftgates, etc.

3. Acquisition Strategy

  • Buy vs. lease vs. rent
  • New vs. used vehicles
  • Replacement cycles
  • Residual value considerations

4. Utilization Optimization

  • Route efficiency
  • Backhaul optimization
  • Asset sharing
  • Cross-functional use

Fleet Sizing Models

Peak Demand Method

import numpy as np
import pandas as pd

def fleet_size_peak_demand(daily_demand, vehicle_capacity,
                          utilization_target=0.85,
                          peak_percentile=95):
    """
    Calculate fleet size based on peak demand

    Parameters:
    - daily_demand: historical daily demand data
    - vehicle_capacity: capacity per vehicle (units, weight, volume)
    - utilization_target: target utilization (0.0-1.0)
    - peak_percentile: percentile for peak planning (e.g., 95)
    """

    # Calculate peak demand at specified percentile
    peak_demand = np.percentile(daily_demand, peak_percentile)

    # Calculate required fleet size
    fleet_size = np.ceil(peak_demand / (vehicle_capacity * utilization_target))

    # Calculate statistics
    avg_demand = np.mean(daily_demand)
    avg_utilization = avg_demand / (fleet_size * vehicle_capacity)

    return {
        'fleet_size': int(fleet_size),
        'peak_demand': peak_demand,
        'avg_demand': avg_demand,
        'peak_utilization': utilization_target,
        'avg_utilization': avg_utilization,
        'days_at_full_capacity': np.sum(daily_demand >= fleet_size * vehicle_capacity)
    }

# Example usage
daily_deliveries = np.random.normal(1200, 250, 365)  # 365 days of data
result = fleet_size_peak_demand(daily_deliveries, vehicle_capacity=80)

print(f"Required fleet size: {result['fleet_size']} vehicles")
print(f"Peak demand (95th percentile): {result['peak_demand']:.0f} deliveries")
print(f"Average utilization: {result['avg_utilization']:.1%}")

Queue Theory Approach

from scipy.stats import poisson
import math

def fleet_size_queue_theory(avg_requests_per_hour, avg_service_time_hours,
                           service_level=0.95):
    """
    Calculate fleet size using queue theory (M/M/c model)

    Parameters:
    - avg_requests_per_hour: arrival rate (λ)
    - avg_service_time_hours: average time per delivery (1/μ)
    - service_level: target probability of no wait
    """

    # Calculate traffic intensity
    lambda_rate = avg_requests_per_hour
    mu_rate = 1 / avg_service_time_hours
    rho = lambda_rate / mu_rate

    # Minimum servers (vehicles) needed
    min_servers = math.ceil(rho)

    # Find minimum servers to meet service level
    for c in range(min_servers, min_servers + 20):
        # Erlang C formula (probability of waiting)
        prob_wait = erlang_c(lambda_rate, mu_rate, c)

        if prob_wait  0:
                self.waiting_customers += 1

            # Perform delivery
            yield self.env.timeout(service_time)
            self.completed_deliveries += 1

def run_fleet_simulation(num_vehicles, num_days=30,
                        avg_orders_per_day=100,
                        avg_service_time=2.0):
    """
    Run fleet simulation

    Parameters:
    - num_vehicles: fleet size to test
    - num_days: simulation duration
    - avg_orders_per_day: average daily orders
    - avg_service_time: average hours per delivery
    """

    env = simpy.Environment()
    fleet = FleetSimulation(env, num_vehicles)

    # Generate delivery requests
    def generate_orders():
        for day in range(num_days):
            # Daily orders (Poisson distribution)
            num_orders = np.random.poisson(avg_orders_per_day)

            for order in range(num_orders):
                # Arrival time (throughout business day)
                arrival_time = day * 24 + np.random.uniform(8, 18)

                # Service time (lognormal distribution)
                service_time = np.random.lognormal(
                    mean=np.log(avg_service_time),
                    sigma=0.5
                )

                env.process(fleet.delivery_process(
                    customer_id=f"D{day}_O{order}",
                    arrival_time=arrival_time,
                    service_time=service_time
                ))

                yield env.timeout(0)

    env.process(generate_orders())
    env.run(until=num_days * 24)

    # Calculate metrics
    service_level = 1 - (fleet.waiting_customers / fleet.completed_deliveries)
    avg_wait = fleet.total_wait_time / fleet.completed_deliveries if fleet.completed_deliveries > 0 else 0
    utilization = fleet.completed_deliveries * avg_service_time / (num_vehicles * num_days * 24)

    return {
        'fleet_size': num_vehicles,
        'completed_deliveries': fleet.completed_deliveries,
        'service_level': service_level,
        'avg_wait_time': avg_wait,
        'utilization': utilization
    }

# Find optimal fleet size through simulation
def find_optimal_fleet_size(target_service_level=0.90):
    """Test different fleet sizes to find optimal"""

    results = []

    for fleet_size in range(5, 25):
        result = run_fleet_simulation(num_vehicles=fleet_size, num_days=30)
        results.append(result)

        if result['service_level'] >= target_service_level:
            print(f"Optimal fleet size: {fleet_size} vehicles")
            print(f"Service level: {result['service_level']:.2%}")
            print(f"Utilization: {result['utilization']:.2%}")
            return result

    return results

Total Cost of Ownership (TCO)

TCO Components

1. Acquisition Costs

  • Purchase price or lease payments
  • Registration and licensing
  • Initial equipment (GPS, racks, etc.)

2. Operating Costs

  • Fuel
  • Maintenance and repairs
  • Tires
  • Insurance
  • Tolls and permits

3. Overhead Costs

  • Depreciation (owned vehicles)
  • Storage/parking
  • Fleet management systems
  • Administrative overhead

4. Disposal Costs

  • Residual value (owned)
  • Lease-end charges (leased)
  • Remarketing costs

TCO Calculator

class VehicleTCO:
    """
    Calculate Total Cost of Ownership for vehicles

    Compares buy vs. lease scenarios
    """

    def __init__(self, vehicle_type):
        self.vehicle_type = vehicle_type

    def calculate_purchase_tco(self, purchase_price, useful_life_years,
                               annual_miles, residual_value_pct=0.20):
        """
        Calculate TCO for purchased vehicle

        Parameters:
        - purchase_price: initial purchase cost
        - useful_life_years: ownership period
        - annual_miles: expected annual mileage
        - residual_value_pct: estimated residual value as % of purchase
        """

        # Annual operating costs
        fuel_cost_per_mile = 0.35  # varies by vehicle type
        maintenance_per_mile = 0.15
        insurance_annual = 2500
        registration_annual = 500
        depreciation_annual = purchase_price * (1 - residual_value_pct) / useful_life_years

        # Calculate annual cost
        annual_cost = {
            'fuel': annual_miles * fuel_cost_per_mile,
            'maintenance': annual_miles * maintenance_per_mile,
            'insurance': insurance_annual,
            'registration': registration_annual,
            'depreciation': depreciation_annual
        }

        total_annual = sum(annual_cost.values())

        # Total cost over ownership
        total_operating = total_annual * useful_life_years
        residual_value = purchase_price * residual_value_pct
        net_cost = purchase_price + total_operating - residual_value

        # Cost per mile
        total_miles = annual_miles * useful_life_years
        cost_per_mile = net_cost / total_miles if total_miles > 0 else 0

        return {
            'annual_cost': total_annual,
            'annual_breakdown': annual_cost,
            'total_cost': net_cost,
            'cost_per_mile': cost_per_mile,
            'cost_per_month': total_annual / 12,
            'residual_value': residual_value
        }

    def calculate_lease_tco(self, monthly_lease_payment, lease_term_years,
                           annual_miles, excess_mile_charge=0.25):
        """
        Calculate TCO for leased vehicle

        Parameters:
        - monthly_lease_payment: monthly lease cost
        - lease_term_years: lease duration
        - annual_miles: expected annual mileage
        - excess_mile_charge: cost per mile over allowance
        """

        lease_allowance_miles = 15000  # typical annual allowance

        # Calculate excess miles
        excess_miles_per_year = max(0, annual_miles - lease_allowance_miles)
        excess_miles_total = excess_miles_per_year * lease_term_years
        excess_miles_cost = excess_miles_total * excess_mile_charge

        # Annual operating costs (lessee responsible)
        fuel_cost_per_mile = 0.35
        insurance_annual = 2500
        registration_annual = 500

        annual_operating = (
            annual_miles * fuel_cost_per_mile +
            insurance_annual +
            registration_annual
        )

        annual_lease_cost = monthly_lease_payment * 12

        # Total cost
        total_lease_payments = annual_lease_cost * lease_term_years
        total_operating = annual_operating * lease_term_years
        total_cost = total_lease_payments + total_operating + excess_miles_cost

        # Cost per mile
        total_miles = annual_miles * lease_term_years
        cost_per_mile = total_cost / total_miles if total_miles > 0 else 0

        return {
            'annual_cost': annual_lease_cost + annual_operating,
            'total_lease_payments': total_lease_payments,
            'excess_miles_cost': excess_miles_cost,
            'total_cost': total_cost,
            'cost_per_mile': cost_per_mile,
            'cost_per_month': (annual_lease_cost + annual_operating) / 12
        }

    def compare_buy_vs_lease(self, purchase_price, lease_monthly,
                            years, annual_miles):
        """
        Compare buying vs. leasing

        Returns comparison with recommendation
        """

        buy_tco = self.calculate_purchase_tco(
            purchase_price=purchase_price,
            useful_life_years=years,
            annual_miles=annual_miles
        )

        lease_tco = self.calculate_lease_tco(
            monthly_lease_payment=lease_monthly,
            lease_term_years=years,
            annual_miles=annual_miles
        )

        savings = lease_tco['total_cost'] - buy_tco['total_cost']
        recommendation = 'Buy' if savings > 0 else 'Lease'

        return {
            'buy': buy_tco,
            'lease': lease_tco,
            'savings_with_buy': savings,
            'recommendation': recommendation,
            'buy_cost_per_mile': buy_tco['cost_per_mile'],
            'lease_cost_per_mile': lease_tco['cost_per_mile']
        }

# Example usage
tco = VehicleTCO('Delivery Van')
comparison = tco.compare_buy_vs_lease(
    purchase_price=45000,
    lease_monthly=650,
    years=5,
    annual_miles=25000
)

print(f"Recommendation: {comparison['recommendation']}")
print(f"Buy TCO: ${comparison['buy']['total_cost']:,.0f}")
print(f"Lease TCO: ${comparison['lease']['total_cost']:,.0f}")
print(f"Savings with buy: ${comparison['savings_with_buy']:,.0f}")

Fleet Replacement Strategy

Optimal Replacement Timing

import numpy as np
from scipy.optimize import minimize_scalar

def optimal_replacement_age(purchase_price, annual_depreciation,
                           annual_maintenance, discount_rate=0.08):
    """
    Calculate optimal vehicle replacement age

    Minimizes equivalent annual cost (EAC)

    Parameters:
    - purchase_price: initial cost
    - annual_depreciation: depreciation schedule (list)
    - annual_maintenance: maintenance cost schedule (list)
    - discount_rate: discount rate for NPV
    """

    def equivalent_annual_cost(age):
        """Calculate EAC for given replacement age"""

        if age  len(annual_maintenance):
            return float('inf')

        age = int(age)

        # Calculate NPV of costs
        npv_costs = purchase_price

        for year in range(1, age + 1):
            discount_factor = (1 + discount_rate) ** -year
            npv_costs += annual_maintenance[year - 1] * discount_factor

        # Calculate residual value
        residual_value = purchase_price
        for year in range(age):
            residual_value -= annual_depreciation[year]

        npv_costs -= residual_value * (1 + discount_rate) ** -age

        # Convert to EAC
        annuity_factor = (
            (discount_rate * (1 + discount_rate) ** age) /
            ((1 + discount_rate) ** age - 1)
        )
        eac = npv_costs * annuity_factor

        return eac

    # Find optimal age
    result = minimize_scalar(
        equivalent_annual_cost,
        bounds=(1, len(annual_maintenance)),
        method='bounded'
    )

    optimal_age = int(result.x)
    min_eac = result.fun

    return {
        'optimal_replacement_age': optimal_age,
        'equivalent_annual_cost': min_eac
    }

# Example: Analyze replacement for delivery truck
purchase_price = 50000
annual_depreciation = [10000, 8000, 6000, 5000, 4000, 3000, 2000]
annual_maintenance = [2000, 2500, 3000, 4000, 5500, 7000, 9000]

result = optimal_replacement_age(
    purchase_price,
    annual_depreciation,
    annual_maintenance
)

print(f"Optimal replacement age: {result['optimal_replacement_age']} years")
print(f"Equivalent annual cost: ${result['equivalent_annual_cost']:,.0f}")

Age-Based Replacement Policy

class FleetReplacementPlanner:
    """
    Plan multi-year fleet replacement strategy

    Accounts for budget constraints and vehicle ages
    """

    def __init__(self, fleet_data, annual_budget):
        """
        Parameters:
        - fleet_data: DataFrame with columns ['vehicle_id', 'age', 'type',
                      'replacement_cost', 'maintenance_cost']
        - annual_budget: maximum annual replacement budget
        """
        self.fleet = fleet_data.copy()
        self.annual_budget = annual_budget

    def prioritize_replacements(self, current_year):
        """
        Prioritize vehicles for replacement

        Scoring based on age, maintenance cost, and utilization
        """

        # Calculate replacement scores
        self.fleet['age_score'] = self.fleet['age'] / 10  # normalize
        self.fleet['maintenance_score'] = (
            self.fleet['maintenance_cost'] /
            self.fleet['maintenance_cost'].median()
        )

        # Combined score (highe

…

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [kishorkukreja](https://github.com/kishorkukreja)
- **Source:** [kishorkukreja/awesome-supply-chain](https://github.com/kishorkukreja/awesome-supply-chain)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.