设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15310|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ \/ a" l" Q; K: D4 e& P* K

' T0 U5 P) \+ U' ]我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 _: F5 @6 y' y9 ?. h9 p# T$ e6 |, K* V# S9 S5 M2 ]+ |1 `- U. G
begin P_read arriving( y) T7 H% q8 [4 ]
    while 1=1 do begin
- ?4 \/ L/ i. Z8 J- t0 i; p2 Z        read A_tote from "data.txt" with delimiter "\n"
: b7 p* C5 T" [/ k2 F        read A_time from "data.txt" with delimiter "\n"
, V/ B  q4 j; l  ]9 F- A        read A_leave from "data.txt" with delimiter "\n"+ x  \( u$ v1 L- A0 q
        read A_picks from "data.txt" with delimiter "\n"
& n- G2 V* J, K1 @( I! t& N. E0 O2 b2 n        set load type to A_tote
" t/ L4 s! B2 {& s) ~        if A_tote="tote 1" then set A_induct to 1
; z, @$ y' _) C3 g4 {$ T0 P        else if A_tote="tote 2" then set A_induct to 2
+ ?" [5 A8 J8 w7 f( @8 C            else set A_induct to 3    4 S+ y; i3 `+ K
        set A_i to 0! Q% e' I& k; c
        clone 1 load to P_induction# ?# L  s7 q) B: f; J# z
        wait for A_time sec4 ?1 @2 {, b) z2 E6 z* g8 J5 a  v
    end& m4 c$ e. R! c  h3 i) \7 d
end
" t6 _4 j) j7 J/ q4 j% X% Q6 o, _0 b- O6 L$ i
begin P_induction arriving
% \( O& }+ g. k/ X- K    if A_induct=1 then clone 1 load to P_pick1, C$ e7 i7 ~" }
    else if A_induct=2 then clone 1 load to P_pick2! j  R* T2 d0 W
        else clone 1 load to P_pick3
  Q/ f, p( D1 D5 hend
7 W; l' m7 \# Z. `8 \5 Z$ x8 i& [& |/ s4 b0 i1 f- v
begin P_pick1 arriving( {3 w6 T+ @1 i) U- s* [+ |$ r
    set A_i to 1
% }8 W* u+ ]( \7 m" ~3 ~    move into Q_induct1; k. M7 h, C5 @* v4 `
    move into pickaisle.induct1
- I/ y0 m( ^! S* o- C: T5 D' R& q; ?( H    while A_i<=30 do begin
) R' u2 {/ g+ C/ R/ S" _5 C; b        travel to pickaisle.con(A_i)
) L: H/ d! a. Q0 a0 G+ |( h6 C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 p8 Q2 n9 p. [/ P7 w        else wait for 10 sec
) U9 V8 c8 }2 k8 X/ B4 c) B        if A_i=A_leave then send to die8 l# M; @0 `2 U
        else inc A_i by 1
' A+ V! q  ^6 f; |: S9 D    end9 p6 P/ l" |+ R0 ?% o
end! D* o, _/ ?% a! C, I& L6 {/ V
$ M( D5 I/ |: I2 j# P2 Y3 G
begin P_pick2 arriving, W/ I* e* u! [( o1 |' o
    set A_i to 111 d! Y  n! {6 O; s# Q+ n
    move into Q_induct2! j% g) S  d' m6 ~# D
    move into pickaisle.induct2
$ @, S* `8 [, f) k# W" I& k    while A_i<=30 do begin
: w. _- S, H0 i& Q. ]& E  P        travel to pickaisle.con(A_i)1 a' y; j+ R! v( Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 k* w. ^  z- i/ }        else wait for 10 sec
5 z0 {9 c' h7 ]. ?8 N        if A_i=A_leave then send to die
6 D9 T+ s' t  K  r: M6 \        else inc A_i by 1
- f5 x% L4 T" A2 }- Z- w$ V    end) g5 K* W5 @9 w# J
end
5 C4 b9 P% @: {7 Y4 ], c' F! T" q: p9 m' v
begin P_pick3 arriving3 D% z8 l2 q& W1 A* K) M
    set A_i to 215 r1 F7 @: q# Q8 r
    move into Q_induct3
6 l, g4 x" U5 P6 F    move into pickaisle.induct3# V9 K* R7 E: S8 K: \1 |, k
    while A_i<=30 do begin
! G' c. m/ Q8 ]0 f* R) l        travel to pickaisle.con(A_i)
! Q1 U! T0 l# v) M$ U% Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 N+ k  V$ M9 c% F6 N! X
        else wait for 10 sec
* G  G- E1 E0 z7 g' z6 n! a        if A_i=A_leave then send to die
$ X1 n# w$ U' v9 Z6 j        else inc A_i by 1
4 N6 U+ ~$ G0 A* ^7 l  }' \# Z    end
- u/ \: b$ K3 u$ V4 G/ x+ Aend

最佳答案

查看完整内容

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是个什么东东?
4 \0 Y. q1 I& `- N% r4 g4 d7 w9 ymove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
& f* A# s! e$ E
1 M  p& i" `! q" Q) }AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。( ~/ H/ d/ C9 D6 m2 h# _
: x2 U: f7 C  I' f5 a
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* j& w9 Y4 P9 l' g  f5 M1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
( e/ r$ a9 A- [/ [2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
- E# |0 G; \, j# p4 X3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
" B; V* [$ V3 h9 Y  ^% s4 ?  mbegin P_induction arriving9 k- O6 R& ^7 S& w8 H2 I
    clone 1 load to P_pick(A_induct)9 K9 P' f9 A( j: Z1 s4 s' w: v
end最大的系
5 K/ ]7 E  e0 C' S6 R6 @: V3 S: N* H
begin P_pick arriving
2 `5 J  o: d: m5 l    set A_i to procindex * 10 + 1
: A$ M$ W9 ^0 N* H! H    move into Q_induct(procindex)% Q' B4 v: L; b& s; z0 `7 }5 m
    move into pickaisle.induct(procindex)
7 ]" O$ E% v- t7 D4 b2 V, ?' l    /*check the type of pickaisle.induct(i), for your last problem.*/
9 H+ O; C8 g7 }5 c
: h% k. e, n) a$ a* r4 T3 e' R3 }    while A_i<=30 do begin, w! h! q3 ?5 _4 \$ z! P  a
        travel to pickaisle.con(A_i)
% [0 |* j' g( e4 p, @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- v0 ]/ n' s4 N0 k, A
        else wait for 10 sec
. i1 g: B! `' j- G  r        if A_i=A_leave then send to die
9 Y' ]( o* c, O  n3 X  g. ?. y4 i; p        else inc A_i by 1
$ L9 q$ M3 S3 U5 ^8 J    end) _& e' M+ A& t9 Y1 ?
end
5 f4 Z/ w, x/ n# O) O+ L
+ E2 w! L/ V2 @2 E7 {其中的procindex为整形,代表当前process的序号。
* I  |9 c4 n# P, V" y% ?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-9-1 08:04 , Processed in 0.019372 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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