# Turn Penalty Transition Calculator AI Agent Connect

> Turn Penalty Transition Calculator MCP handles the math for transition penalties in graph-based routing. It evaluates the cost of moving between edges by looking at turn angles, junction delays, and specific penalty rules. Your AI client can use these tools to determine edge-to-edge weights or validate that turn geometry makes sense for your navigation models.

## Overview
- **Category:** mathematics
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_K6qDyWTOJIU2R16T1DKJfM3XLqwE0CxMf2s0nSFC/ai-agent-connect
- **Tags:** graph, routing, penalty, junction, navigation

## Description

If you are building or refining routing algorithms, you know that moving through a junction isn't free. This MCP handles the heavy lifting of calculating transition penalties at graph junctions. Instead of manually calculating how a sharp turn or a specific delay affects a path, you let your AI agent do it. 

You can use this to find the exact weight of moving from one edge to another, or you can run batch calculations to see each possible movement at a specific node. It also lets you test how new penalty rules might change your routing costs without rewriting your entire codebase. Whether you need to check if a turn angle is mathematically valid or simulate the impact of a new rule, this MCP provides the specific math tools to keep your graph logic consistent and accurate.

## Tools

### turn_batch_calculate_junction
This tool calculates each possible transition at a single junction for a set of connected edges.

### turn_validate_geometry
This tool checks if a provided turn angle and turn type are logically and mathematically consistent.

### turn_calculate_transition
Use this to find the total cost of a specific movement between two edges at a junction.

### turn_get_rule_impact
This tool determines how a specific penalty rule changes the cost of a single transition.

## Prompt Examples

**Prompt:** 
```
Calculate the transition cost for a right turn (90 degrees) at junction J1, where the incoming edge is E1, the outgoing edge is E2, the base weights are 10 and 15, the delay is 2, and the penalty rule is a flat 5 for right turns.
```

**Response:** 
```
The total penalty is 5, and the updated edge-to-edge weight is 32.
```

**Prompt:** 
```
Is a turn with an angle of 175 degrees and type 'u_turn' valid?
```

**Response:** 
```
Yes, the turn is valid.
```

**Prompt:** 
```
What is the impact of a 'sharp_turn' rule that adds 10 to any turn angle greater than 45 degrees?
```

**Response:** 
```
The rule is triggered, and the penalty value is 10.
```

## Capabilities

### Junction Cost Calculation
Your agent calculates the weight of moving between specific edges.

### Batch Processing
Your agent evaluates all possible movements at a node simultaneously.

### Rule Simulation
Your agent tests how new penalty rules affect transition costs.

### Geometric Validation
The tool checks if turn angles and types are logically sound.

## Use Cases

### Route Optimization
Calculate how adding a penalty for left turns changes the shortest path in a city graph.

### Data Validation
Verify that turn angles in a large dataset are logically possible for the given turn types.

### Algorithm Testing
Simulate the impact of junction delays on total travel time across multiple nodes.

### Graph Modeling
Determine all possible transition costs at a specific intersection for a routing engine.

## Benefits

- Automates the math for edge-to-edge transition weights.
- Enables rapid testing of new penalty rules.
- Ensures turn logic remains mathematically consistent.
- Reduces manual calculation errors in graph modeling.

## How It Works

Connect your client to Vinkius to access these math tools instantly.

1. Connect your MCP-compatible client to Vinkius.
2. Provide the junction data or edge weights to your AI agent.
3. Your agent calls the specific tool needed for the calculation.
4. The MCP returns the calculated penalty or validation result.
5. Your agent uses the result to update your routing model or answer your question.

## Frequently Asked Questions

**What can this MCP calculate?**
It calculates transition penalties, edge-to-edge weights, and the impact of specific penalty rules at graph junctions.

**How do I use this with Claude or Cursor?**
You connect your client to the Vinkius platform, which hosts the MCP, and then you can immediately start asking your agent to perform these calculations.

**Can I test new rules without changing my code?**
Yes, you can use the rule impact tool to simulate how a specific penalty rule would affect a transition.

**Does it validate turn geometry?**
Yes, the validation tool checks if turn angles and types are mathematically and logically consistent.

**Is it possible to calculate all transitions at once?**
Yes, the batch calculation tool evaluates all possible movements at a single junction for a set of connected edges.

**How do I calculate the cost of a specific turn?**
You can use the `turn_calculate_transition` tool by providing the incoming and outgoing edge IDs, the turn angle, the turn type, and your penalty rules.

**Can I evaluate all possible paths through a junction at once?**
Yes, the `turn_batch_calculate_junction` tool allows you to calculate all valid transitions for a set of connected edges at a specific junction ID.

**How are penalties applied?**
Penalties are applied based on the rules you provide. You can use `turn_get_rule_impact` to test how a single rule affects a turn before applying it to your full calculation.
