Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions jCOS/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.vscode
target
jMetal.log
.idea
47 changes: 47 additions & 0 deletions jCOS/createRestrictions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# NAME

createRestrictions

# VERSION

1.0

# AUTHOR

Khaos Research Group

Juan Carlos Ruiz Ruiz (juancaruru@uma.es)

# DATE

20/09/2023

# DESCRIPTION
Generate the semantics JSON file from an OWL ontology for an specific optimization problem.

> :exclamation: It is important that the JSON input full is not a formated JSON or a JSON array. If multiple cases want to be resolved, the input file must be a JSON file with multiple JSON objects separated by a new line.

# DOCKER

## Build

```
docker build -t docker.io/create_restrictions -f createRestrictions.dockerfile .
```

## Run

```
docker run -v $(pwd)/data:/usr/local/src/data/ docker.io/create_restrictions <problem-type> <semantics> (optional) <input-file> <clients-number>
```

# Parameters

* **`problem-type` (str)** -> The type of problem we want to resolve ('electric', 'knapsack' or 'multiobjective-knapsack').
* **`semantics` (str)** -> The ontology (OWL file) we want to insert into our problem input.
* **`input-file` (str)** -> The JSON file with the problem information.
* **`clients-number` (int)** -> For the electric problem we need the number of clients to extract from \<input-file\>.

# Outputs

* restrictions.json
43 changes: 43 additions & 0 deletions jCOS/createRestrictions/createRestrictions.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Type: Dockerfile
# Description: Dockerfile for the jCOS createRestrictions component

# Create the build image

FROM maven:3.6.3-jdk-11 AS build

LABEL Khaos Research Group <khaos.uma.es>

# Set the working directory

WORKDIR /usr/local/src/

# Copy the pom.xml file to the working directory

COPY ./script/pom.xml .

# Download the dependencies

RUN mvn dependency:go-offline -B

# Build the component jar file

COPY ./script/src ./src
RUN mvn package

# Create the java image

FROM openjdk:11-jre-slim as app

WORKDIR /usr/local/src/

# Copy the jar file from the build image to the java image

COPY --from=build /usr/local/src/target/jCOS_CreateRestrictions-1.0-SNAPSHOT-jar-with-dependencies.jar .

# Set the working directory

COPY . /usr/local/src/

# Set the entrypoint

ENTRYPOINT ["java","-jar","jCOS_CreateRestrictions-1.0-SNAPSHOT-jar-with-dependencies.jar"]
Loading