diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..13566b81b018ad684f3a35fee301741b2734c8f4 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000000000000000000000000000000000000..919ce1f1f77253454105acb2aad9997c1047a0e6 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,7 @@ +<component name="ProjectCodeStyleConfiguration"> + <code_scheme name="Project" version="173"> + <ScalaCodeStyleSettings> + <option name="MULTILINE_STRING_CLOSING_QUOTES_ON_NEW_LINE" value="true" /> + </ScalaCodeStyleSettings> + </code_scheme> +</component> \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000000000000000000000000000000000000..a55e7a179bde3e4e772c29c0c85e53354aa54618 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ +<component name="ProjectCodeStyleConfiguration"> + <state> + <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" /> + </state> +</component> \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000000000000000000000000000000000000..89734b62750aa1ad074d437b6198aa070f7454ae --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="CompilerConfiguration"> + <annotationProcessing> + <profile name="Maven default annotation processors profile" enabled="true"> + <sourceOutputDir name="target/generated-sources/annotations" /> + <sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> + <outputRelativeToContentRoot value="true" /> + <module name="mapd_file_rouge" /> + </profile> + </annotationProcessing> + </component> +</project> \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000000000000000000000000000000000000..aa00ffab7828f4818589659c804ec2cfd99baed3 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="Encoding"> + <file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" /> + <file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" /> + </component> +</project> \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000000000000000000000000000000000000..712ab9d985c20018a0c97b93d2148ac1ffe588a5 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="RemoteRepositoriesConfiguration"> + <remote-repository> + <option name="id" value="central" /> + <option name="name" value="Central Repository" /> + <option name="url" value="https://repo.maven.apache.org/maven2" /> + </remote-repository> + <remote-repository> + <option name="id" value="central" /> + <option name="name" value="Maven Central repository" /> + <option name="url" value="https://repo1.maven.org/maven2" /> + </remote-repository> + <remote-repository> + <option name="id" value="jboss.community" /> + <option name="name" value="JBoss Community repository" /> + <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" /> + </remote-repository> + </component> +</project> \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000000000000000000000000000000000000..ca0df7fff913a3a9907525b7218caaa5b2eb68c0 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ExternalStorageConfigurationManager" enabled="true" /> + <component name="MavenProjectsManager"> + <option name="originalFiles"> + <list> + <option value="$PROJECT_DIR$/pom.xml" /> + </list> + </option> + </component> + <component name="PDMPlugin"> + <option name="skipTestSources" value="false" /> + </component> + <component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="openjdk-21" project-jdk-type="JavaSDK" /> +</project> \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000000000000000000000000000000000000..35eb1ddfbbc029bcab630581847471d7f238ec53 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="" vcs="Git" /> + </component> +</project> \ No newline at end of file diff --git a/src/main/java/org/petriNet/Arc.java b/src/main/java/org/petriNet/Arc.java new file mode 100644 index 0000000000000000000000000000000000000000..30bff9bab917eec4239b5d0807d8be36fb9b7d1a --- /dev/null +++ b/src/main/java/org/petriNet/Arc.java @@ -0,0 +1,31 @@ +package org.petriNet; + +public class Arc { + protected int poid; // weight + protected int id; + + public Arc(int poid,int id) { + this.poid = poid; + this.id = id; + } + + public void modifier_poid(int nouveauPoid) { + this.poid = nouveauPoid; + } + + // Validation method (abstract in derived classes) + public boolean valider() { + // Implement validation logic if needed + return true; + } + + public int getPoid() { + return poid; + } + + public void setPoid(int poid) { + this.poid = poid; + } +} + +} diff --git a/src/main/java/org/petriNet/Place.java b/src/main/java/org/petriNet/Place.java new file mode 100644 index 0000000000000000000000000000000000000000..4dadc11de536088b39a8e0397c19fda10a74da40 --- /dev/null +++ b/src/main/java/org/petriNet/Place.java @@ -0,0 +1,38 @@ +package org.petriNet; + +public class Place { + private int id; + private int nombre_jeton; + public Place(int id, int nombre_jeton) { + this.id = id; + this.nombre_jeton = nombre_jeton; + } + + public void ajouter_jeton() { + this.nombre_jeton++; + } + + public void enlever_jeton() { + if (this.nombre_jeton > 0) { + this.nombre_jeton--; + } else { + System.out.println("No more tokens to remove."); + } + } + + public int get_nombre_jetons() { + return this.nombre_jeton; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public void setNombre_jeton(int nombre_jeton) { + this.nombre_jeton = nombre_jeton; + } +} diff --git a/src/main/java/org/petriNet/Transition.java b/src/main/java/org/petriNet/Transition.java new file mode 100644 index 0000000000000000000000000000000000000000..132a5dd5c57fde699b06c5428193cab0dd6af20b --- /dev/null +++ b/src/main/java/org/petriNet/Transition.java @@ -0,0 +1,13 @@ +package org.petriNet; + +public class Transition { + private int id; + + public Transition(int id) { + this.id = id; + } + public void est_tirable() { + } + public void tirer(){ + } +}