Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Projet_Pne
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
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
AlifIhsan Syauqi
Projet_Pne
Commits
1bb503ba
Commit
1bb503ba
authored
3 weeks ago
by
Rabemanantsoa VonaMpiaro
Browse files
Options
Downloads
Patches
Plain Diff
Ajoutée des fichiers
parent
c8ffa361
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
LES TA DES TACHES/src/job_2.c
+107
-0
107 additions, 0 deletions
LES TA DES TACHES/src/job_2.c
LES TA DES TACHES/src/job_3.c
+56
-0
56 additions, 0 deletions
LES TA DES TACHES/src/job_3.c
with
163 additions
and
0 deletions
LES TA DES TACHES/src/job_2.c
0 → 100644
+
107
−
0
View file @
1bb503ba
#include
"job_2.h"
#include
"job_1 (1).h"
#include
"list.h"
#include
<stdlib.h>
#include
<stdio.h>
#include
<string.h>
#include
<assert.h>
job_t
*
new_empty_job
(){
job_t
*
J
=
calloc
(
1
,
sizeof
(
job_t
)
);
assert
(
J
);
J
->
precedence
=
new_list
(
);
J
->
posteriority
=
new_list
(
);
J
->
rank
=
UNDEF
;
J
->
au_plus_tard
=
UNDEF
;
J
->
au_plus_tot
=
UNDEF
;
J
->
marge_totale
=
UNDEF
;
J
->
critique
=
false
;
return
J
;
}
job_t
*
new_job
(
char
*
title
){
job_t
*
J
=
new_empty_job
(
);
J
->
title
=
strdup
(
title
);
return
J
;
}
void
free_job
(
job_t
**
ptrJ
){
assert
(
ptrJ
&&
*
ptrJ
);
if
(
(
*
ptrJ
)
->
title
)
free
(
(
*
ptrJ
)
->
title
);
free
(
*
ptrJ
);
*
ptrJ
=
NULL
;
}
void
view_job
(
job_t
*
J
)
{
printf
(
"JOB %s
\n\t
preceeded by ["
,
get_job_tilte
(
J
)
);
for
(
elmlist_t
*
E
=
get_head
(
J
->
precedence
);
E
;
E
=
get_suc
(
E
)
)
{
printf
(
" %s"
,
get_job_tilte
(
get_data
(
E
)
)
);
}
printf
(
" ]
\n
"
);
// if ( !get_numelm ( J->posteriority ) ) printf ( "\t" );
printf
(
"
\t
followed by ["
);
for
(
elmlist_t
*
E
=
get_head
(
J
->
posteriority
);
E
;
E
=
get_suc
(
E
)){
printf
(
" %s"
,
get_job_tilte
(
get_data
(
E
)));
}
printf
(
" ]
\n
"
);
printf
(
"
\t
iDeg=%d
\t
oDeg=%d
\t
life=%2.2lf"
,
J
->
input_degree
,
J
->
output_degree
,
J
->
life
);
printf
(
"
\t
rank="
);
if
(
J
->
rank
==
UNDEF
)
printf
(
"U"
);
else
printf
(
"%d"
,
J
->
rank
);
printf
(
"
\t
early="
);
if
(
J
->
au_plus_tot
==
UNDEF
)
printf
(
"U"
);
else
printf
(
"%2.2lf"
,
J
->
au_plus_tot
);
printf
(
"
\t
late="
);
if
(
J
->
au_plus_tard
==
UNDEF
)
printf
(
"U"
);
else
printf
(
"%2.2lf"
,
J
->
au_plus_tard
);
printf
(
"
\t
totale= "
);
if
(
J
->
marge_totale
==
UNDEF
)
printf
(
"U"
);
else
printf
(
"%2.2lf"
,
J
->
marge_totale
);
printf
(
"
\t
critical= "
);
if
(
J
->
critique
)
printf
(
"Y
\n
"
);
else
printf
(
"N
\n
"
);
}
char
*
get_job_tilte
(
job_t
*
J
)
{
assert
(
J
);
return
J
->
title
;
}
// Sets the title of the job, freeing the old title if needed.
void
set_job_title
(
job_t
*
J
,
char
*
title
)
{
assert
(
J
&&
title
);
if
(
J
->
title
)
free
(
J
->
title
);
J
->
title
=
strdup
(
title
);
}
// Returns the life (duration) of the job.
double
get_job_life
(
job_t
*
J
)
{
assert
(
J
);
return
J
->
life
;
}
// Sets the life (duration) of the job.
void
set_job_life
(
job_t
*
J
,
double
life
)
{
assert
(
J
);
J
->
life
=
life
;
}
// Returns the input degree (number of precedents) of the job.
int
get_job_iDegree
(
job_t
*
J
)
{
assert
(
J
);
return
J
->
input_degree
;
}
// Sets the input degree of the job.
void
set_job_iDegree
(
job_t
*
J
,
int
iDegree
)
{
assert
(
J
);
J
->
input_degree
=
iDegree
;
}
// Increments the input degree of the job.
void
incr_job_iDegree
(
job_t
*
J
)
{
assert
(
J
);
J
->
input_degree
++
;
}
// Decrements the input degree of the job.
void
decr_job_iDegree
(
job_t
*
J
)
{
assert
(
J
);
J
->
input_degree
--
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
LES TA DES TACHES/src/job_3.c
0 → 100644
+
56
−
0
View file @
1bb503ba
#include
"job_1 (1).h"
#include
"job_3.h"
#include
<assert.h>
#include
<stdlib.h>
#include
<stdio.h>
#include
<string.h>
//TOUS EST CHANGee
int
get_job_oDegree
(
job_t
*
J
)
{
assert
(
J
);
return
J
->
output_degree
;
}
void
set_job_oDegree
(
job_t
*
J
,
int
oDegree
)
{
assert
(
J
);
J
->
output_degree
=
oDegree
;
}
void
incr_job_oDegree
(
job_t
*
J
)
{
assert
(
J
);
J
->
output_degree
++
;
}
void
decr_job_oDegree
(
job_t
*
J
)
{
assert
(
J
);
J
->
output_degree
--
;
}
int
get_job_rank
(
job_t
*
J
)
{
assert
(
J
);
return
J
->
rank
;
}
void
set_rank
(
job_t
*
J
,
int
rank
)
{
assert
(
J
);
J
->
rank
=
rank
;
}
int
titleJobCmp
(
job_t
*
J1
,
job_t
*
J2
)
{
assert
(
J1
&&
J2
);
return
strcmp
(
J1
->
title
,
J2
->
title
);
}
int
iDegreeJobCmp
(
job_t
*
J1
,
job_t
*
J2
)
{
assert
(
J1
&&
J2
);
return
J1
->
input_degree
-
J2
->
input_degree
;
}
int
oDegreeJobCmp
(
job_t
*
J1
,
job_t
*
J2
)
{
assert
(
J1
&&
J2
);
return
J1
->
output_degree
-
J2
->
output_degree
;
}
int
rangJobCmp
(
job_t
*
J1
,
job_t
*
J2
)
{
assert
(
J1
&&
J2
);
return
J1
->
rank
-
J2
->
rank
;
}
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