how a access array element and send to user for task

This is my code
% Structure of array user set
user(1).will = 0.5;
user(1).rep = 1;
user(1).bid = [9,8,7];
user(1).inter_time=4;
user(2).will = 0.9;
user(2).rep = 0.6;
user(2).bid = [6,5,7];
user(2).inter_time=7;
% Structure of Array of user set
task(1).bud = 8;
task(1).qua = 1;
task(2).bud = 9;
task(2).qua = 2;
task(3).bud = 7;
task(3).qua = 1;
s = zeros(1,3*2);
for i=1:2
for j=1:3
%fprintf('i=%d j=%d\n',i,j);
if(not (user(i).bid(j)<=task(j).bud))
continue;
end
com_data_quality = (user(i).will*user(i).rep/user(i).bid(j)*user(i).inter_time);
s((i-1)*3+j)= com_data_quality;
b = sort(s,'descend');
fprintf('value is %f task is=%d user is=%d \n', com_data_quality,j,i);
end
end
OUTPUT:
value is 0.250000 task is=2 user is=1
value is 0.285714 task is=3 user is=1
value is 0.630000 task is=1 user is=2
value is 0.756000 task is=2 user is=2
value is 0.540000 task is=3 user is=2
b =
0.7560 0.6300 0.5400 0.2857 0.2500 0 (decending order)
Now my question is here array b is in decending order of com_data_quality,here user 2 for task 2 give the highest data quality i want to send this task for user 2...and then assign the task to user with highest data quality.
how i write this code for this process.
Please help me.

5 comentarios

Jan
Jan el 25 de Mzo. de 2019
Editada: Jan el 25 de Mzo. de 2019
I've formatted your code today. Please use the button to do this in future questions.
What exactly is your question? I cannot know, how you can "send the task to a user". Which task? What does "assign" mean?
In this code,here we take 2 user and 3 task,depends on different input of user1,user2 we calculate the comprehensive_data_quality of task1,task2 and task3.
and storeing the value in array(decending order)
in the output section user2 give com_data_quality 0.6300 for task1
then we want to send task1 to the user2
similarly
user2 give com_data_quality 0.7500 for task2
then we want to send task2 to the user2
user2 give com_data_quality 0.5400 for task3
then we want to send task3 to the user2
this is the concept of assign the task...
how i write the matlab code for this concept....please help me.
Guillaume
Guillaume el 25 de Mzo. de 2019
Again, what does send [a task] to [a user] actually mean? Is the program supposed to write an email to [a user] to tell him he's got to do [task]? Presumably, you mean something else. We have no idea what.
Sanjoy Dey
Sanjoy Dey el 25 de Mzo. de 2019
Editada: Sanjoy Dey el 25 de Mzo. de 2019
suppose somewhere held an accident and we want to click the picture of that place this is the task...we want to involve some person(user) who will capture the picture.Now we will select those person on the basis of there provided data_quality(depends on capturing image).
in this code we already calculated the data quality and we have arranged on decending order.
now i want to assign the task on the basis of highest data quality that's provides user.
In the output section user2 give com_data_quality 0.6300 for task1
then we want to send task1 to the user2
similarly
user2 give com_data_quality 0.7500 for task2
then we want to send task2 to the user2
user2 give com_data_quality 0.5400 for task3
then we want to send task3 to the user2
this is the concept of assign the task...
we have already stored the value with highest quality in array in decending order...
we want send the task to that user who is providing the highest data quality that's why i want to write a matlab code for this concept....Please help me
Thank you
Jan
Jan el 26 de Mzo. de 2019
@Sanjoy Dey: These explanations are still to abstract to understand, what you want to do. There is no Matlab command to perform a "involve some person" or "send task 1 to user 2".
Matlab could send an email, if the address is known. Or you can create a struct, which contains the field "solvedBy" and set the contents to the char vector "user 1". Maybe you want to store a specific file in a certain folder. You still did not mention, what the code should do.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Preguntada:

el 25 de Mzo. de 2019

Comentada:

Jan
el 26 de Mzo. de 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by