Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MAPD_file_rouge
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AROUISSI Khaoula
MAPD_file_rouge
Commits
0ad23ee8
Commit
0ad23ee8
authored
6 months ago
by
BOUZAZI Firas
Browse files
Options
Downloads
Patches
Plain Diff
final
parent
4c399dae
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/org/petriNet/MainSpecialVideur.java
+0
-51
0 additions, 51 deletions
src/main/java/org/petriNet/MainSpecialVideur.java
src/main/java/org/petriNet/MainSpecialZero.java
+0
-51
0 additions, 51 deletions
src/main/java/org/petriNet/MainSpecialZero.java
with
0 additions
and
102 deletions
src/main/java/org/petriNet/MainSpecialVideur.java
deleted
100644 → 0
+
0
−
51
View file @
4c399dae
package
org.petriNet
;
public
class
MainSpecialVideur
{
public
static
void
main
(
String
[]
args
)
{
// Initialize the Petri network
PetriNet
petriNetwork
=
new
PetriNet
();
// Create places
Place
place1
=
new
Place
(
2
,
petriNetwork
.
generateId
(
1
));
Place
place2
=
new
Place
(
4
,
petriNetwork
.
generateId
(
1
));
// Add places to the network
petriNetwork
.
addPlace
(
place1
);
petriNetwork
.
addPlace
(
place2
);
// Create a transition
Transition
transition1
=
new
Transition
(
"T1"
,
petriNetwork
.
generateId
(
2
));
// Add the transition to the network
petriNetwork
.
addTransition
(
transition1
);
// Create arcs and add them to the network
// Incoming arc from place2 to transition1 with weight 1
IncomingArc_Videur
incomingArc_videur
=
new
IncomingArc_Videur
(
transition1
,
place2
,
1
,
petriNetwork
.
generateId
(
0
));
petriNetwork
.
addArc
(
incomingArc_videur
);
transition1
.
addIncomingArc
(
incomingArc_videur
);
// Outgoing arc from transition1 to place1 with weight 1
OutgoingArc
outgoingArc
=
new
OutgoingArc
(
transition1
,
place1
,
1
,
petriNetwork
.
generateId
(
0
));
petriNetwork
.
addArc
(
outgoingArc
);
transition1
.
addOutgoingArc
(
outgoingArc
);
// Display the initial state of the Petri network
System
.
out
.
println
(
"Initial State of Petri Network:"
);
petriNetwork
.
displayNetwork
();
// Activate the transition
System
.
out
.
println
(
"\nActivating transition T1..."
);
petriNetwork
.
fireTransition
(
String
.
valueOf
(
transition1
.
getId
()));
// Display the state of the Petri network after activation
System
.
out
.
println
(
"\nState of Petri Network after Transition T1 Activation:"
);
petriNetwork
.
displayNetwork
();
// Example assertions to verify changes
System
.
out
.
println
(
"\nVerifying state:"
);
System
.
out
.
println
(
"Tokens in Place 1 (expected 3): "
+
place1
.
getTokenCount
());
System
.
out
.
println
(
"Tokens in Place 2 (expected 0): "
+
place2
.
getTokenCount
());
}
}
This diff is collapsed.
Click to expand it.
src/main/java/org/petriNet/MainSpecialZero.java
deleted
100644 → 0
+
0
−
51
View file @
4c399dae
package
org.petriNet
;
public
class
MainSpecialZero
{
public
static
void
main
(
String
[]
args
)
{
// Initialize the Petri network
PetriNet
petriNetwork
=
new
PetriNet
();
// Create places
Place
place1
=
new
Place
(
3
,
petriNetwork
.
generateId
(
1
));
Place
place2
=
new
Place
(
0
,
petriNetwork
.
generateId
(
1
));
// Add places to the network
petriNetwork
.
addPlace
(
place1
);
petriNetwork
.
addPlace
(
place2
);
// Create a transition
Transition
transition1
=
new
Transition
(
"T1"
,
petriNetwork
.
generateId
(
2
));
// Add the transition to the network
petriNetwork
.
addTransition
(
transition1
);
// Create arcs and add them to the network
// Incoming arc from place2 to transition1 with weight 1
IncomingArc_Zero
incomingArc_zero
=
new
IncomingArc_Zero
(
transition1
,
place2
,
1
,
petriNetwork
.
generateId
(
0
));
petriNetwork
.
addArc
(
incomingArc_zero
);
transition1
.
addIncomingArc
(
incomingArc_zero
);
// Outgoing arc from transition1 to place1 with weight 1
OutgoingArc
outgoingArc
=
new
OutgoingArc
(
transition1
,
place1
,
1
,
petriNetwork
.
generateId
(
0
));
petriNetwork
.
addArc
(
outgoingArc
);
transition1
.
addOutgoingArc
(
outgoingArc
);
// Display the initial state of the Petri network
System
.
out
.
println
(
"Initial State of Petri Network:"
);
petriNetwork
.
displayNetwork
();
// Activate the transition
System
.
out
.
println
(
"\nActivating transition T1..."
);
petriNetwork
.
fireTransition
(
String
.
valueOf
(
transition1
.
getId
()));
// Display the state of the Petri network after activation
System
.
out
.
println
(
"\nState of Petri Network after Transition T1 Activation:"
);
petriNetwork
.
displayNetwork
();
// Example assertions to verify changes
System
.
out
.
println
(
"\nVerifying state:"
);
System
.
out
.
println
(
"Tokens in Place 1 (expected 4): "
+
place1
.
getTokenCount
());
System
.
out
.
println
(
"Tokens in Place 2 (expected 0): "
+
place2
.
getTokenCount
());
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment