Giter Site home page Giter Site logo

unist_ai's Introduction

# UI Section

The server can be started by running main.py.

- main.py
- scheduling.py
- verification.py
These three files communicate with the Kakaotalk channel and sends the required responses. The detailed information about Kakaotalk API can be found at https://i.kakao.com/docs/skill-response-format#skillpayload.

- user_info.csv
This file includes information about the drivers that are currently registered to our service. The file will refuse the schedule request if the driver is not registered in this file.

- etc
This directory includes images that are required when sending responses to the Kakaotalk channel.

- downward_package
This directory includes the source codes of Fast Downward. Note that some of the files of Fast Downward are not pushed to this git due to memory limitation problem.

- solver/location_mapping.csv
For making the situation simple in the demo, we made a simple coordinate system of 10*20 to locate stores and customers. However, to show how our service provides the solutions using Kakao Map, we needed some actual locations. To remove this gap, we defined this location mapping file which maps each locations in the original 10*20 coordinate to an actual location. 

-solver/data_rapping.py
This file reads the planning result and reformats it in a way that the Kakaotalk API can understand.

----------------------------------------------------------------------------------------------------------------------------------------

# AI Planning Section

After clients' orders are finalized, order information file is generated,
like, unist_AI/solver/inputs/problem1.json.

This json file will be converted to pddl format file by script below.
```
base_dir = pathlib.Path().absolute()
save_dir = os.path.join(base_dir, 'solver', 'results')
import_dir = os.path.join(base_dir, 'solver', 'inputs')

with open(os.path.join(import_dir, f'problem{input_num}.json')) as fp:
    test_data = json.load(fp)['requests']
    
builder = ProblemFile(f"problem{input_num}", import_dir, import_dir, test_data)
builder.export()
```
converted pddl file examples are here too (unist_AI/solver/inputs/problem1.pddl)

And By using Fast Downward alorithm, AI solver is exeucted. 
We run it from python script with prepared shell script(run_fd.sh)

```
cmd = f'bash /workspace/d_avengers/solver/run_fd.sh /workspace/d_avengers/solver/inputs/problem{input_num}.pddl'
subprocess.call(shlex.split(cmd))
```

unist_AI/solver/run_fd.sh 
```
/workspace/d_avengers/downward_package/fast-downward.py /workspace/d_avengers/solver/domain.pddl $1 --heuristic "hff=cg()" --search "lazy_greedy([hff],preferred=[hff])"
mv sas_plan /workspace/d_avengers/solver/results/sas_plan
echo 'Successfully Planned.'
```

We can't use sas_plan file directly, it need to be transformed to our system's format.
By using script below, we can get unist_AI/solver/results/plan1.csv file.
```
plan_path = os.path.join(save_dir, 'sas_plan')
menu_path = os.path.join(base_dir, 'solver', 'builder', 'predefined', 'menu.json')
order_path = os.path.join(import_dir, f'problem{input_num}.json')
transform_plan(plan_path, menu_path, order_path, input_num)
```

System will send kakaotalk messages to driver with that csv result.

unist_ai's People

Contributors

juyoungbang avatar knn940506 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.