decision-support
Provide data-driven decision support for construction. Analyze multiple factors and recommend optimal project decisions.
What this skill does
# Decision Support System
## Business Case
### Problem Statement
Construction decision-making challenges:
- Multiple conflicting criteria
- Risk and uncertainty
- Time pressure for decisions
- Lack of structured analysis
### Solution
Multi-criteria decision support system for construction projects with weighted scoring, risk analysis, and scenario comparison.
## Technical Implementation
```python
import pandas as pd
from typing import Dict, Any, List, Optional, Callable
from dataclasses import dataclass, field
from datetime import date, datetime
from enum import Enum
import math
class DecisionType(Enum):
VENDOR_SELECTION = "vendor_selection"
METHOD_SELECTION = "method_selection"
SCHEDULE_OPTION = "schedule_option"
DESIGN_ALTERNATIVE = "design_alternative"
RISK_RESPONSE = "risk_response"
RESOURCE_ALLOCATION = "resource_allocation"
class CriterionType(Enum):
COST = "cost"
TIME = "time"
QUALITY = "quality"
SAFETY = "safety"
RISK = "risk"
SUSTAINABILITY = "sustainability"
@dataclass
class Criterion:
criterion_id: str
name: str
criterion_type: CriterionType
weight: float # 0-1
higher_is_better: bool = True
unit: str = ""
@dataclass
class Alternative:
alternative_id: str
name: str
description: str
scores: Dict[str, float] = field(default_factory=dict)
risks: List[str] = field(default_factory=list)
@dataclass
class DecisionResult:
alternative_id: str
weighted_score: float
rank: int
strengths: List[str]
weaknesses: List[str]
class DecisionSupportSystem:
"""Multi-criteria decision support for construction projects."""
def __init__(self, project_name: str):
self.project_name = project_name
self.criteria: Dict[str, Criterion] = {}
self.alternatives: Dict[str, Alternative] = {}
self.decision_type: DecisionType = DecisionType.METHOD_SELECTION
def set_decision_type(self, decision_type: DecisionType):
"""Set the type of decision being made."""
self.decision_type = decision_type
def add_criterion(self, criterion: Criterion):
"""Add evaluation criterion."""
self.criteria[criterion.criterion_id] = criterion
def add_standard_criteria(self, decision_type: DecisionType = None):
"""Add standard criteria based on decision type."""
dt = decision_type or self.decision_type
if dt == DecisionType.VENDOR_SELECTION:
criteria = [
Criterion("price", "Price", CriterionType.COST, 0.30, False, "$"),
Criterion("quality", "Quality Rating", CriterionType.QUALITY, 0.25, True, "1-10"),
Criterion("delivery", "Delivery Time", CriterionType.TIME, 0.20, False, "days"),
Criterion("experience", "Experience", CriterionType.QUALITY, 0.15, True, "years"),
Criterion("safety", "Safety Record", CriterionType.SAFETY, 0.10, True, "score"),
]
elif dt == DecisionType.METHOD_SELECTION:
criteria = [
Criterion("cost", "Total Cost", CriterionType.COST, 0.25, False, "$"),
Criterion("duration", "Duration", CriterionType.TIME, 0.25, False, "days"),
Criterion("quality", "Quality", CriterionType.QUALITY, 0.20, True, "score"),
Criterion("risk", "Risk Level", CriterionType.RISK, 0.15, False, "1-5"),
Criterion("sustainability", "Sustainability", CriterionType.SUSTAINABILITY, 0.15, True, "score"),
]
elif dt == DecisionType.RISK_RESPONSE:
criteria = [
Criterion("effectiveness", "Effectiveness", CriterionType.QUALITY, 0.35, True, "%"),
Criterion("cost", "Implementation Cost", CriterionType.COST, 0.25, False, "$"),
Criterion("time", "Implementation Time", CriterionType.TIME, 0.20, False, "days"),
Criterion("feasibility", "Feasibility", CriterionType.QUALITY, 0.20, True, "1-10"),
]
else:
criteria = [
Criterion("cost", "Cost", CriterionType.COST, 0.30, False, "$"),
Criterion("time", "Time", CriterionType.TIME, 0.25, False, "days"),
Criterion("quality", "Quality", CriterionType.QUALITY, 0.25, True, "score"),
Criterion("risk", "Risk", CriterionType.RISK, 0.20, False, "score"),
]
for c in criteria:
self.add_criterion(c)
def add_alternative(self, alternative: Alternative):
"""Add decision alternative."""
self.alternatives[alternative.alternative_id] = alternative
def normalize_scores(self) -> Dict[str, Dict[str, float]]:
"""Normalize scores to 0-1 scale."""
normalized = {}
for criterion_id, criterion in self.criteria.items():
values = [alt.scores.get(criterion_id, 0) for alt in self.alternatives.values()]
if not values or max(values) == min(values):
for alt_id in self.alternatives:
if alt_id not in normalized:
normalized[alt_id] = {}
normalized[alt_id][criterion_id] = 0.5
continue
min_val, max_val = min(values), max(values)
range_val = max_val - min_val
for alt_id, alt in self.alternatives.items():
if alt_id not in normalized:
normalized[alt_id] = {}
raw_score = alt.scores.get(criterion_id, 0)
# Normalize
norm_score = (raw_score - min_val) / range_val if range_val > 0 else 0.5
# Invert if lower is better
if not criterion.higher_is_better:
norm_score = 1 - norm_score
normalized[alt_id][criterion_id] = round(norm_score, 4)
return normalized
def calculate_weighted_scores(self) -> Dict[str, float]:
"""Calculate weighted scores for all alternatives."""
normalized = self.normalize_scores()
weighted = {}
for alt_id, scores in normalized.items():
total = 0
for criterion_id, norm_score in scores.items():
weight = self.criteria[criterion_id].weight
total += norm_score * weight
weighted[alt_id] = round(total, 4)
return weighted
def analyze_alternatives(self) -> List[DecisionResult]:
"""Analyze and rank all alternatives."""
weighted_scores = self.calculate_weighted_scores()
normalized = self.normalize_scores()
# Rank alternatives
ranked = sorted(weighted_scores.items(), key=lambda x: x[1], reverse=True)
results = []
for rank, (alt_id, score) in enumerate(ranked, 1):
alt = self.alternatives[alt_id]
# Identify strengths (top 2 criteria)
strengths = []
weaknesses = []
alt_scores = [(cid, normalized[alt_id][cid]) for cid in self.criteria]
alt_scores_sorted = sorted(alt_scores, key=lambda x: x[1], reverse=True)
for cid, nscore in alt_scores_sorted[:2]:
if nscore >= 0.6:
strengths.append(f"{self.criteria[cid].name}: {nscore:.2f}")
for cid, nscore in alt_scores_sorted[-2:]:
if nscore <= 0.4:
weaknesses.append(f"{self.criteria[cid].name}: {nscore:.2f}")
results.append(DecisionResult(
alternative_id=alt_id,
weighted_score=score,
rank=rank,
strengths=strengths,
weaknesses=weaknesses
))
return results
def get_recommendation(self) -> Dict[str, Any]:
"""Get decision recommendation."""
results = self.analyze_alternatives()
if not results:
return {"error": "No alternatives to analyze"}
best = results[0]
beRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.