question

mark zhen avatar image
0 Likes"
mark zhen asked mark zhen commented

Define the state of reinforcement learning

I think I'm almost done, the state of my model now,

I want to define it as the number of deferred order but I'm a bit confused on how to do it?

And I define my actions I take six different actions

The part about the reward may be to minimize the tardness or to calculate the average of the overall tardness (but I don't know how to calculate the average in flexsim)

As for the label part, I have defined four labels in the source

ArrivalTime is the arrival time of the goods

date is the delivery time

total arrival total arrival time

mark the order in which goods enter

I want to calculate the average tardness in the global table of flexsim. How should I do it?

@Kavika F @Felix Möhlmann @Jason Lightfoot

rule0905_autosave.fsm

FlexSim 22.0.16
reinforcement learningmachine learning
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

New post here.

Hi @mark zhen , was one of Jason Lightfoot's or Felix Möhlmann's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·
mark zhen avatar image mark zhen Jason Lightfoot ♦♦ commented ·

I do not understand what you mean!!

0 Likes 0 ·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered mark zhen commented

You could just sum up the tardiness of each entering item in a label on the sink. Then get the average by dividing that value by the input stat.

1694020679762.png

rule0905-autosave.fsm


1694020679762.png (24.8 KiB)
rule0905-autosave.fsm (394.2 KiB)
· 7
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

mark zhen avatar image mark zhen commented ·

I have another question to ask about my state. I am currently trying to calculate how many orders I have in total that are delayed, but I feel that my approach may not be right.

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ mark zhen commented ·
That can just be a counter on a label that you increment with item.tardiness>0.


Please do the all tutorials if you haven't already or consult your academic institution's training material.
0 Likes 0 ·
mark zhen avatar image mark zhen Jason Lightfoot ♦♦ commented ·

No, I've done the calculation, but I want to treat it as my state, and my model has this done, but there may be some definitions or details that I haven't dealt with.

0 Likes 0 ·
Show more comments
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered

The rolling average for the label on the sink would be:

((N-1)*avgTardiness+item.tardiness)/N

Using the global table you can use :

Table.query("SELECT AVG(tardiness) FROM [entry time]")[1][1]

..if the tardiness field contains the lateness of each item (not the rolling average).

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.