设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14803|回复: 2

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

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

/ X! E  @# z1 o6 f我的问题是,在每个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中的数值,不知道会不会有什么不妥。5 d! y% g- j! ?  M: ?

7 s" P- x7 M) A+ F) U5 |$ q4 T: P& ]3 hbegin P_read arriving( z! v6 b5 a  I1 |
    while 1=1 do begin2 B4 I& w9 M. [2 }" V
        read A_tote from "data.txt" with delimiter "\n"
  m* T0 d0 o: x/ E- t        read A_time from "data.txt" with delimiter "\n"
) F0 {0 a$ R. M/ p+ C8 f/ o        read A_leave from "data.txt" with delimiter "\n"( E2 s. c" |6 C; F3 f: R
        read A_picks from "data.txt" with delimiter "\n") p2 `- A8 O! u' z& y
        set load type to A_tote
$ h8 T7 B) A6 T' X  q        if A_tote="tote 1" then set A_induct to 10 ?, Y1 r8 I( o9 p+ M! r+ e
        else if A_tote="tote 2" then set A_induct to 2
, W0 i  V0 u% h- e+ D( n2 l            else set A_induct to 3   
  w( v- m3 M9 ]8 C        set A_i to 0
6 I/ |' P9 ~2 L& u0 W9 [  Y) n        clone 1 load to P_induction
+ F8 T. q) b5 M' u        wait for A_time sec
2 I# z+ l. w4 Y1 d    end/ H+ J6 i+ o7 g4 A" H: ^
end: H5 n3 O( m) H# m' ^
6 u* M6 r2 l, p6 z' P# P0 E- X4 c: A
begin P_induction arriving
9 h) o% k; S7 ]7 ^! r    if A_induct=1 then clone 1 load to P_pick1$ a" K/ r" P6 h" s; d$ s( b- ?# p! a
    else if A_induct=2 then clone 1 load to P_pick2: u  i9 o3 n+ [! }& }
        else clone 1 load to P_pick3
: N& M4 E0 j$ X: kend. n9 I$ {/ M) j0 v1 u  @' z
: A! F! _. E: t2 g9 w* D0 ~
begin P_pick1 arriving( z3 O2 D) ?4 n8 v) p
    set A_i to 1
# m% n% F* p+ A# f    move into Q_induct1: T/ \( v" a+ R0 I3 h6 N
    move into pickaisle.induct1; {/ ^2 j8 ]4 s4 F+ u
    while A_i<=30 do begin& |+ l: h* m/ `# \) e2 l/ c1 n
        travel to pickaisle.con(A_i)% i; N% G1 {7 p/ u+ R$ b* A' v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& m9 l4 O8 X# r) g, d: R5 z
        else wait for 10 sec9 |! H  s- [6 i5 f* G2 e5 S+ F. r* V
        if A_i=A_leave then send to die
! y( j! u/ K) ~* [1 l        else inc A_i by 1
2 \2 C# z! p+ \& O    end
$ R$ I. }& m% c( S3 Iend! t: T# R' g$ [5 Y! ~1 r
; A, x; q+ [: `* p" L: x& s# q2 ^' g
begin P_pick2 arriving
- L4 k6 `! C# ?- g6 H    set A_i to 11, }: D2 k; B( H0 i( b
    move into Q_induct2& z) Z( m2 @$ d" Y
    move into pickaisle.induct25 Q5 a6 ]( Y; U2 q
    while A_i<=30 do begin
& B8 j; {+ R2 b/ g7 U/ e5 H/ z        travel to pickaisle.con(A_i)
; C0 H3 f* J9 D/ Q: n5 n4 i8 R' i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 S1 L! l) W2 ~8 O        else wait for 10 sec5 f1 B1 V( j) g7 J7 U; G
        if A_i=A_leave then send to die4 D% K6 F- W- \- n! `0 ?* }
        else inc A_i by 15 V. p, c2 u0 L# ^' K4 \' `
    end; w) z3 z  N" o  O3 j
end& L8 Y# W+ m7 j" i7 L0 ?

! U/ Y1 V# k; Rbegin P_pick3 arriving/ r' d3 X+ ~- b
    set A_i to 212 k7 [0 f: K2 i0 n! F3 v- o2 ]
    move into Q_induct3
2 ]+ q8 p- j$ ?& X    move into pickaisle.induct3/ e! K0 {" F  H9 `1 X7 Q" M
    while A_i<=30 do begin, o0 \5 p6 Q, I1 G/ z3 a" n6 K
        travel to pickaisle.con(A_i)  x7 ~" w* ]2 c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ E0 E- L6 e6 ^, g% L! L1 W3 u        else wait for 10 sec0 b' a+ }0 o4 z  J4 |' [8 r! G
        if A_i=A_leave then send to die2 ~" j5 f0 v( ]/ c$ D3 Y
        else inc A_i by 1
; H  {$ \2 X8 k5 R    end
; L* Z$ G! |4 t' \# m1 Iend

最佳答案

查看完整内容

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是个什么东东?
! R: i1 \5 g1 _% k: }' ymove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
9 W" y2 O$ R2 b8 s: Y8 }) R( G4 t! ~( K. u. H4 T- i
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
3 Z3 |$ Y3 q2 `: m2 A: V- ]
) s, `. i+ H9 Q) s/ B( L" P% n7 Q另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:- M0 B3 a# |& u' @: E, @" K4 P
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
6 Z* W2 ^' i# r8 s, O2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ d" x3 R( ]; S3 s$ B3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:5 @8 k4 m" v9 a1 ^) h: q, b  L4 o
begin P_induction arriving9 A7 i) ]( V- D' T# P
    clone 1 load to P_pick(A_induct)  o9 t7 u4 R' o1 q# ]; w
end最大的系; H  ?9 c$ u) j

$ i: Q# n& v) v3 _# ^' X8 b$ Y: j: ~begin P_pick arriving9 j, y, D$ K5 H9 d, ^
    set A_i to procindex * 10 + 1
' n+ F7 l8 l- k( v" l    move into Q_induct(procindex)  h: a0 y" w; v+ E
    move into pickaisle.induct(procindex)9 R# A, H$ v% ?8 e8 _
    /*check the type of pickaisle.induct(i), for your last problem.*// [) u' X# w4 d2 U. Z' ^8 C& w) P

2 ^- t4 R4 g/ x% f! j0 P    while A_i<=30 do begin8 Z' e9 h* d" E" P9 S: Y% e; s# i; e
        travel to pickaisle.con(A_i)3 `. a& P& B3 y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 i1 d" U5 R6 I# @  B  v
        else wait for 10 sec4 c) m! U7 k* g8 \, O8 i. G9 r9 e
        if A_i=A_leave then send to die
7 V" F: G/ O3 ^3 g        else inc A_i by 1. x' v( b! q9 \2 t# D: u
    end; E8 f5 i! t" R! U0 |0 l; W1 s
end/ a( ~5 ]1 K$ j' \0 f

0 K0 a0 R! O$ {% m6 ^+ W9 k其中的procindex为整形,代表当前process的序号。
" o' P- J1 M; M8 ?1 B( {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-7-27 06:14 , Processed in 0.012057 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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