AI prompts
base on Script is to assign exam centers to students # Exam Center Randomization Script
The goal of this script is to assign __exam centers__ to students.
## Steps
1. Prepare input files in the specified format.
2. Run the program and re-run if -
* Any school has students who have not been assigned a center.
* Distribution across centers is uneven.
3. Perform sanity checks of distributed centers.
4. Manually reassign impractical centers and odd lot allocations. Keep changes to a minimum.
## Allocation Guidelines
- हरेक विद्यालयमा परिक्षार्थीको संख्या र परीक्षा केन्द्रको सिट संख्या लिने
- हरेक विद्यालय र केन्द्रको गुगल म्यापबाट latitude, longitude निकाली दुरी निकाल्ने आधारको रुपमा प्रयोग गर्ने
- विद्यालयबाट नजिक पर्ने केन्द्रलाई प्राथमिकता दिनुपर्ने
- एक विद्यालयको परिक्षार्थी संख्या हेरी सकभर १००, २०० भन्दा बढी परीक्षार्थी एकै केन्द्रमा नपर्ने गरी बाँढ्न पर्ने
- आफ्नै विद्यालयमा केन्द्र पार्न नहुने
- दुई विद्यालयका परीक्षार्थीको केन्द्र एक अर्कामा पर्न नहुने, अर्थात् कुनै विद्यालयका परीक्षार्थीको केन्द्र परेको विद्यालयका परीक्षार्थीहरूको केन्द्र अघिल्लो विद्यालयमा पार्न नहुने
- एकै स्वामित्व / व्यवस्थापनको भनी पहिचान भएका केन्द्रमा पार्न नहुने
- विगतमा कुनै विद्यालयको कुनै केन्द्रमा पार्दा समस्या देखिएकोमा केन्द्र दोहोऱ्याउन नहुने
- प्रत्येक पटक केन्द्र तोक्ने प्रोग्राम चलाउदा फरक फरक नतिजा आउने गरी ऱ्यान्डमाइज भएको हुनु पर्ने
## Parameters
| Variable | Value | Description |
|--------------------------|-------|---------------------------------------------|
| `PREF_DISTANCE_THRESHOLD` | 2 | Preferred threshold distance in km |
| `ABS_DISTANCE_THRESHOLD` | 7 | Absolute threshold distance in km |
| `MIN_STUDENT_IN_CENTER` | 10 | Min. no of students from a school to be assigned to a center in normal circumstances |
| `STRETCH_CAPACITY_FACTOR` | 0.02 | Factor determining how much center capacity can be stretched if needed |
| `PREF_CUTOFF` | -4 | Cutoff value for preference score allocation |
### Input Files
#### school.tsv
- One entry per school.
```tsv
scode count name-address lat long
27101 1776 काठमाण्डौ मोडेल मा.वि., वागवजार 27.7067463495 85.3188922809
27007 1700 ट्रिनीटी इन्टरनेशनल मा.वि., डिल्लीबजार 27.7038931952 85.3251961353
27045 1278 साउथ वेस्टर्न स्टेट मा.वि., बसुन्धारा 27.7396600173 85.3254532539
27127 1210 क्यापिटल मा.वि., कोटेश्वर 27.673541693 85.3449013829
```
#### centers.tsv
- One entry per center.
>`cscode == scode`
```tsv
cscode capacity name address नाम ठेगाना lat long
27003 500 NATIONAL SCHOOL OF SCIENCES SECONDARY SCHOOL LAINCHAUR नेशनल स्कुल अफ साइन्सेस मा.वि लैनचौर 27.71933026 85.31413793
27051 500 UNIGLOBE MA VI KAMALADI युनिग्लोब मा.वि कमलादी 27.70792875 85.32068522
27045 568 SOUTH WESTERN ACADEMY SECONDARY SCHOOL BASUNDHARA साउथ वेर्ष्टन एकेडेमी मा.वि. बसुन्धरा 27.74212647 85.33392421
```
#### prefs.tsv
- Prioritize or deprioritize school and center pair. Negative pref score deprioritizes.
- If pref score is less than `PREF_CUTOFF` center will be excluded from consideration.
```tsv
scode cscode pref reason
27xxx 27yyy -5 same management
27yyy 27xxx -5 same management
27aaa 27bbb -1 last year's center
```
## Command
To run `school_center.py` use the command below:
```bash
python3 school_center.py sample_data/schools_grade12_2081.tsv sample_data/centers_grade12_2081.tsv sample_data/prefs.tsv
```
To run streamlit app locally, install streamlit and use this command:
```bash
streamlit run app.py
```
## Output
```
🚀 24-04-22 20:40:27 - __main__ - INFO - Remaining capacity at each center (remaining_capacity cscode):
Remaining capacity at center (-ve if stretched capacity is used)
|
🚀 24-04-22 20:40:27 - __main__ - INFO - [(-11, '27022'), (-11, '27045'), (-11, '27057')]
|
center code
🚀 24-04-22 20:40:27 - __main__ - INFO - Total remaining capacity across all centers: 161
🚀 24-04-22 20:40:27 - __main__ - INFO - Students not assigned: 0
```
", Assign "at most 3 tags" to the expected json: {"id":"9510","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"