设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12347|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! g6 l3 ^! ^/ W% ?3 i5 e$ t9 N6 P
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ {9 d% G) Y7 r2 k! j
' q8 n; w$ K! ^: b( g) Pbegin P_read arriving
4 u( F3 W5 N: Q# x    while 1=1 do begin
6 w% ]% ^5 R$ H6 @+ ]! x        read A_tote from "data.txt" with delimiter "\n"
# D5 I) Z& I+ y+ V+ P) p0 E        read A_time from "data.txt" with delimiter "\n"8 k* H2 V7 l1 i1 s+ S1 o' e: v
        read A_leave from "data.txt" with delimiter "\n"
% k+ o1 I( t# a) a6 y        read A_picks from "data.txt" with delimiter "\n"
! u6 q( c* P" h" F9 z# w        set load type to A_tote
6 c5 G3 o5 \  W1 m8 C7 o7 S        if A_tote="tote 1" then set A_induct to 1% e9 h; o3 A8 Q/ ?$ f- |; q) O/ T
        else if A_tote="tote 2" then set A_induct to 2
9 S2 H& _' |0 N: c            else set A_induct to 3   
, i' Q# A$ S9 v( S: ^" \5 ^, Q        set A_i to 0
4 K' K* _! w/ l2 u0 V        clone 1 load to P_induction
( ?9 D- a$ v1 E9 n) |* e        wait for A_time sec! g4 Q4 ?- v) g1 D, x  q* s- @
    end0 g1 u6 q$ X0 N
end
3 o* ^$ X2 A& r; o, x+ a5 ]
  }/ u5 |7 L" `begin P_induction arriving
2 T" E+ b6 _2 Y5 l    if A_induct=1 then clone 1 load to P_pick1' c6 H& H$ u$ G. y5 W
    else if A_induct=2 then clone 1 load to P_pick2
- K7 W! ]' g5 Y0 n9 I7 g        else clone 1 load to P_pick34 g$ e1 \  o) ?8 O
end5 h+ x* l1 H' U' W2 X

* M# `& w+ f4 L8 obegin P_pick1 arriving
0 }6 T% |; U; k5 D$ `    set A_i to 1. i1 q& W/ [2 C9 X
    move into Q_induct1
6 \( ~6 @! t) [( B$ _    move into pickaisle.induct12 f" b) \% A$ \& t
    while A_i<=30 do begin
2 J" n; c! I$ n" c        travel to pickaisle.con(A_i)* S2 h, ]& q/ B4 B- {8 r2 f& b, G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 o! Y- i2 Q6 |+ {: f. ^3 m; F        else wait for 10 sec, R7 j& z& s% V9 a! a5 q
        if A_i=A_leave then send to die, g6 m! Y$ f4 N8 K4 S& n; E
        else inc A_i by 1
, j+ Z2 `$ S3 C+ j* b    end6 h* l9 Y$ m/ A) {" X5 F
end0 z, J* j: l7 h% U; C
! H4 l$ k# N% n, N- a* @, a
begin P_pick2 arriving
0 g* P2 {) r% ?& M$ O6 w- W  r    set A_i to 11
1 V! w( \! O: P. b: C    move into Q_induct2
2 z. X& X; l3 M& @9 y    move into pickaisle.induct2* ?  D  e" d( j9 q! B7 A2 B. b
    while A_i<=30 do begin# b* ]' [& }' A' t  @
        travel to pickaisle.con(A_i): P# g- e# p5 |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, e2 Y' W4 b# m4 |8 f; I4 y# T0 D        else wait for 10 sec
3 G. T% c, I$ C3 @1 K        if A_i=A_leave then send to die. }5 v+ p  }, \, i7 h
        else inc A_i by 1: K2 e  z9 l  [) s' a/ s
    end3 m" Y7 y6 P: p
end  D6 p5 u+ K  a
7 T8 {7 }( W# x7 o; F; v/ ^
begin P_pick3 arriving
( }0 D0 W* y2 @3 v: `    set A_i to 21! ^# |! j$ r: A6 F2 a
    move into Q_induct34 e: o, k& x7 ?6 s7 I5 _
    move into pickaisle.induct32 {% P" y: Z0 P
    while A_i<=30 do begin
7 P  J/ P% e6 N5 t  D        travel to pickaisle.con(A_i)
. j& m( ~" e1 ~$ D; \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% u1 p* S! F8 P1 ?. O  ~2 D; I
        else wait for 10 sec
$ P  x: T; r" c/ K" L) G2 p        if A_i=A_leave then send to die7 q4 M8 j. K: {
        else inc A_i by 1. m( p% i$ c, o4 S! {% u2 s
    end
- d, O( c& Y, P  V1 Y3 a6 Oend

最佳答案

查看完整内容

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是个什么东东?! V1 T" \9 O5 N6 y; Y/ h3 i' g
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?. W- s3 u# Y3 N

' P# D0 k8 h" KAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ c' `2 m' q! ?" X3 y
/ y* @/ |$ c! ~7 U
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:3 Z9 N8 j0 s7 w4 f
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;7 t. F  R; ^) J0 z
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& _+ @* j2 {5 Y( l' Q
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
1 }0 C* V7 C8 N7 ?* V* m7 w+ C3 Ebegin P_induction arriving9 m2 e& w  e+ x1 C
    clone 1 load to P_pick(A_induct)! P4 Q; N- P, Z# s/ L, F& m3 T
end最大的系2 d# t% n* D* F% g6 j
9 A  G  i0 y" ]3 p* R
begin P_pick arriving
, ~$ @8 k9 A6 ?" I, U    set A_i to procindex * 10 + 1( K6 E9 s) @) T* {7 h4 ~
    move into Q_induct(procindex)
. q5 `0 q5 }# D/ v& D8 n    move into pickaisle.induct(procindex)) {% u2 R" |+ q6 \0 |1 Q
    /*check the type of pickaisle.induct(i), for your last problem.*/" k1 i+ T9 C+ g" y, C, J( {

6 z+ f" r7 l9 c, {+ D0 V0 }    while A_i<=30 do begin: ?  m2 X6 h8 s2 _% Q
        travel to pickaisle.con(A_i)
8 v# f% @, j; Q- H. }' _1 M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 z6 S& |, G8 _6 t
        else wait for 10 sec5 T# v; Z9 ?4 P
        if A_i=A_leave then send to die, j! Y: Q2 b1 ]
        else inc A_i by 1
' p* L4 P2 X! |    end
" i' o; M9 t( V* l- pend# i0 y& L" A" b: y
+ q& [& b  N$ }4 g, l: h
其中的procindex为整形,代表当前process的序号。5 w( u$ H" A) D) ~, P( F1 Q( `
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-1-16 12:32 , Processed in 0.012815 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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