Skip to content

Instantly share code, notes, and snippets.

@lethain
Last active May 10, 2025 02:28
Show Gist options
  • Select an option

  • Save lethain/34ca7ad6c65c59dbfb0235d49bf55245 to your computer and use it in GitHub Desktop.

Select an option

Save lethain/34ca7ad6c65c59dbfb0235d49bf55245 to your computer and use it in GitHub Desktop.
from systems.parse import parse
import pandas as pd
# Define the model specification
spec = """
# Hiring Pipeline Model
[PotentialCandidates] > Outreaches @ 10
Outreaches > Interested @ Conversion(0.5)
Interested > Active @ Conversion(0.5)
Active > Offers @ Conversion(0.1)
Offers > Hires @ Conversion(0.7)
"""
# Parse the model and run it for 10 rounds
model = parse(spec)
results = model.run(rounds=10)
# Convert results to a pandas DataFrame for nice display
df = pd.DataFrame(results)
# Display the table (remove the infinite PotentialCandidates column)
if 'PotentialCandidates' in df.columns:
df = df.drop(columns=['PotentialCandidates'])
print("Hiring Pipeline Results:")
print(df)
# Optional: Calculate cumulative hires over time
print("\nCumulative Hires Over Time:")
print(df['Hires'].cumsum())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment