设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15091|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& z8 a. O3 Z8 E  s# ]

  g1 a. k5 J/ f' J/ K  M; n  E我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。
7 n, D$ B2 J) u$ K
& ?" G( m5 a1 M$ w% T4 x+ T1 ]7 Qbegin P_read arriving
7 x8 n0 @* s! d5 F- `    while 1=1 do begin
: r5 o# v, E! r6 r3 c5 W4 K* d        read A_tote from "data.txt" with delimiter "\n"- D6 |+ R* N1 F4 J
        read A_time from "data.txt" with delimiter "\n"4 Q/ X9 M& _; J% ~
        read A_leave from "data.txt" with delimiter "\n"
& D$ o- h% N0 ~+ V3 g$ N        read A_picks from "data.txt" with delimiter "\n"
: h* R; E- ^/ t3 B# }        set load type to A_tote% A! d, n% l, o; C0 v' J
        if A_tote="tote 1" then set A_induct to 1% ^# f- S3 E7 x1 y! Z
        else if A_tote="tote 2" then set A_induct to 2
# J& @# \( ~% Y9 h0 I( z1 y' R            else set A_induct to 3    ) [# b" g  _/ [* c* ^0 u
        set A_i to 0
0 s# \8 k. Q! q- H8 ~& e4 j7 P* }        clone 1 load to P_induction
  G& ?1 X# H* T. v7 P        wait for A_time sec
) W6 |0 c* }( Q    end
- o' B3 @4 {# j7 Y: b+ b$ Tend- l# m  D1 h* b( D0 m" ]8 S- o
& i4 O4 K4 Q! i; D1 u
begin P_induction arriving7 g* m  a$ b2 Z  F& G# c/ I! P& Z$ H  f
    if A_induct=1 then clone 1 load to P_pick1
7 p) ~- h" b/ v( p    else if A_induct=2 then clone 1 load to P_pick2
+ e2 f% }- f! y) g* f5 \        else clone 1 load to P_pick3" x8 {$ R- l* n
end; c7 N" U! N" Q8 `$ V, Q/ @
& N: B8 y5 L7 b$ y: q7 @
begin P_pick1 arriving8 {5 w9 @2 B. Q+ T
    set A_i to 1
+ M+ ^; n* d! m2 }    move into Q_induct1* N  q( X* H, G, U- ]1 C
    move into pickaisle.induct1! \' T$ K! w/ W! x4 o" O
    while A_i<=30 do begin
  f. J7 W- I  x$ b  j        travel to pickaisle.con(A_i)6 Y8 C- V" d1 h2 d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 P5 t/ Y+ ~5 T0 k% P2 T        else wait for 10 sec6 q  x2 s* ^- p7 e$ ]7 S
        if A_i=A_leave then send to die* ]% [- S, J) W7 y. w
        else inc A_i by 1# Q  u7 D% @7 E$ |3 F) N* n1 z. N
    end
7 |' c; o" j+ m, C# Cend
" u8 T1 Y$ n- C5 w5 A# b9 u% @
begin P_pick2 arriving
1 u  o" ^+ z* f/ U    set A_i to 11! v4 E; ]( b9 C9 C* g
    move into Q_induct29 P# r% U( k: n
    move into pickaisle.induct2. a/ R  f; M( o0 v
    while A_i<=30 do begin6 H1 ~! X" |8 O3 v: Y  p2 W
        travel to pickaisle.con(A_i), w2 G4 y' Y% t+ L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# i4 ^/ a! _* N! \8 D8 L# k! P
        else wait for 10 sec7 F3 F4 i' u3 r7 N/ i# G) G
        if A_i=A_leave then send to die: {: R  q. E5 s' p! L) o
        else inc A_i by 1
9 q" e/ F9 H4 f1 }* j, {" P    end- E0 l: k$ F" w6 i) T) L
end8 {/ ^3 F3 ~3 G# ~' K( f1 k2 C5 n

4 L- Z9 e: ]! I  Rbegin P_pick3 arriving
3 v; c! i4 v! G! L- H, D- x    set A_i to 21: u, n" O: ]0 q5 a
    move into Q_induct3+ I  a  L% C4 n9 |, K2 m" j8 `* q
    move into pickaisle.induct32 S# D8 [9 ], S1 I
    while A_i<=30 do begin
+ D5 j# D  P* ]' h: [+ H        travel to pickaisle.con(A_i)# C" x/ L0 a% u; H, k+ W0 Z$ b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 F) J! h# |4 a$ r& ~
        else wait for 10 sec7 M; P4 R$ Z/ R* M4 e' `/ _
        if A_i=A_leave then send to die
6 h- c, U  z  z# o        else inc A_i by 1
, |5 y& T/ Z; O! M+ l: U' i    end; s- `4 t1 l1 ~* d6 D
end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?' L- U% b' y1 l0 W) F- [
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
8 ~- ?3 A6 L( o4 H: a
/ i* P# X& V% V- I  o# EAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
0 `' q4 Q5 ^# J/ F  b  b$ i0 L) Q# A9 L
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
, H7 {# d4 I/ U* O: s1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;( O; p# r3 |0 K* p3 s8 Q
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;: R* _( A! ~/ i4 e
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
! Y  {  u( ~( z7 ]3 ^8 Y1 h2 ?6 \begin P_induction arriving
& z5 _9 d: D' z; |    clone 1 load to P_pick(A_induct)" x% J8 t0 Y1 q/ V+ s0 B
end最大的系
5 W' o9 P4 e3 B, ?
7 B# ^. {, {, B: v* nbegin P_pick arriving
* v6 G# M1 G; M' T/ \/ B: Y    set A_i to procindex * 10 + 11 o6 D: o0 x/ g& R
    move into Q_induct(procindex)
  X9 s+ p5 @/ T* G8 b3 K4 l9 Y    move into pickaisle.induct(procindex)
4 T! x* ^. P3 W# ~8 U    /*check the type of pickaisle.induct(i), for your last problem.*/6 h5 I  B5 h& H2 j/ e' t

6 M/ \, }! \! n: W- q    while A_i<=30 do begin2 \9 X% j* ~% Q( K, i* c8 k
        travel to pickaisle.con(A_i), \; ]: j& T$ p4 M: e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; h3 s! x( e# b8 K: L
        else wait for 10 sec
+ o2 y+ `5 Z; L        if A_i=A_leave then send to die- C6 P8 G' E  l; k
        else inc A_i by 1* Q6 c" }' \" S# T1 P2 [
    end7 D- c( w1 c$ }; n7 Y% X" R
end
3 [$ d* K8 _& `* T0 N6 m0 Q$ [+ p+ `: V3 k* b- w
其中的procindex为整形,代表当前process的序号。% p1 u* v( E, t
station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-8-9 16:15 , Processed in 0.016319 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表