File size: 1,058 Bytes
99f938a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python
"""

Generate sample inference output for testing.



Use this to test validation without running full inference.

"""

import sys
import time


def main():
    """Generate sample logs"""
    
    print("[START] task=intersection-management env=autonomous-traffic-control model=Qwen/Qwen2.5-72B-Instruct")
    
    rewards = []
    for step in range(1, 9):
        import random
        reward = round(random.uniform(0.4, 0.9), 2)
        rewards.append(reward)
        
        done = "true" if step == 8 else "false"
        action = f"GREEN_NS(duration={10+step}s)"
        
        print(f"[STEP] step={step} action={action} reward={reward:.2f} done={done} error=null")
        time.sleep(0.1)
    
    score = round(sum(rewards) / len(rewards), 3)
    success = "true" if score >= 0.5 else "false"
    rewards_str = ",".join(f"{r:.2f}" for r in rewards)
    
    print(f"[END] success={success} steps={len(rewards)} score={score:.3f} rewards={rewards_str}")


if __name__ == "__main__":
    main()