设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9493|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 w6 \) I. r/ M0 b% M4 F7 B
7 `% h$ }, {- `8 w
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 l0 D& ~' e; [2 x/ e5 b3 g1 W- J( G5 Y' o) [6 W1 O
begin P_read arriving
1 I# t' s9 ~, y) w  E2 z* t    while 1=1 do begin% i! n+ k  K& x% h# P) c$ |5 I
        read A_tote from "data.txt" with delimiter "\n"( L2 {0 U+ ^" J! g; L
        read A_time from "data.txt" with delimiter "\n"
" ^5 Y- e8 ~) s7 }        read A_leave from "data.txt" with delimiter "\n"; [0 U9 [& {; M, g* L4 W# f  J
        read A_picks from "data.txt" with delimiter "\n"8 B& m) }% d) U
        set load type to A_tote
: [- j% ]- @- z- m- A- K9 B8 t2 K: f        if A_tote="tote 1" then set A_induct to 1
( b$ o6 a7 w3 P) e7 a        else if A_tote="tote 2" then set A_induct to 27 L; Z2 i$ R( v; Y' \
            else set A_induct to 3    + A$ n9 U/ D- Q. F
        set A_i to 0
0 C. o0 l3 O( g7 y6 E$ H        clone 1 load to P_induction
/ M" k  o7 O! X  L        wait for A_time sec
: I6 C4 T& ?5 _! G+ L5 q. w5 r    end
, L/ b. t& b9 A" n2 w8 P0 c' _4 zend
: L/ J! H) ]8 T* \" g" N* C" C/ j2 |7 k: E0 y
begin P_induction arriving
  Y$ M, q4 q5 {* H; A    if A_induct=1 then clone 1 load to P_pick1
) c& h" L% O% ~* q6 {( u    else if A_induct=2 then clone 1 load to P_pick2
; e: g" o# D) l. M# G2 Y) U        else clone 1 load to P_pick3
( w1 c1 x& H0 K* w% V/ N; X7 yend
8 Q) M  _! U. N' O! @4 X
, O. O  n5 V* hbegin P_pick1 arriving, `+ Y  K, \$ a  l+ k+ Q+ N2 {  w
    set A_i to 1
0 m" {/ M6 l' s3 x( C3 R6 e    move into Q_induct1
* K+ E! s8 H: V6 ~+ t3 b" t    move into pickaisle.induct1, ?* Q2 R7 t) Z" _
    while A_i<=30 do begin% G  e) p* g% W: ~
        travel to pickaisle.con(A_i)
) x% b  B' ~- z! p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ r0 `  K  z! S* {5 E
        else wait for 10 sec) f. I1 t! [5 V
        if A_i=A_leave then send to die- I$ ~% O; H  ^9 h  J4 n" V  _
        else inc A_i by 16 ?( k" ^1 B& i& C0 ^9 B' W
    end1 |: _, ^8 w) C7 `
end4 e% @0 \+ t/ p2 u4 T

4 K+ V7 q" Z4 pbegin P_pick2 arriving3 d5 ^8 }; y+ J1 o2 ^# `
    set A_i to 11
5 g# L( r& U2 \, X    move into Q_induct2% T3 D( t  C6 J) r4 o( R* g3 `
    move into pickaisle.induct22 a/ i6 u! D6 K8 G
    while A_i<=30 do begin( t$ ]% e) @) `9 z  L
        travel to pickaisle.con(A_i)0 ^- y4 f0 H! f( J0 B9 d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 A# @* W; q" h- W
        else wait for 10 sec
/ Q2 d% _0 v: I' `8 m        if A_i=A_leave then send to die  }) h) R. K" s
        else inc A_i by 1
' z/ t$ v0 o, Q    end  G3 `+ P7 x1 b! X
end
& T2 v2 N6 z/ U: Y3 ~+ ~) G2 v! Z) s2 |( P, p: I4 o# H" x" v3 e7 P
begin P_pick3 arriving
. J) Q4 \+ |$ a. O8 U" q# H) Z0 j) v3 h    set A_i to 21
4 V5 E# n% s; N6 b$ Q- \! v. {$ [) H    move into Q_induct3
$ h$ [0 x4 s2 ?# k& J, k    move into pickaisle.induct31 `; A( K) O1 M" U* x1 z
    while A_i<=30 do begin# j1 R/ k$ k8 j/ ]8 r- B6 w2 ]
        travel to pickaisle.con(A_i), G- l1 [4 V2 ]  j/ e6 L- k* H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: v: @; ]8 R7 h: O+ {        else wait for 10 sec
3 E2 E/ E! w, ^( Q: j3 I7 E        if A_i=A_leave then send to die
. }2 [' C7 {$ c: b7 B; c        else inc A_i by 12 m1 Q/ b/ j' C
    end
- P9 g& ?, w  ]0 S' _) ?: j, Bend

最佳答案

查看完整内容

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是个什么东东?' w% t6 b* r, h- I/ E
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
3 B* u5 K0 c  M4 ~
/ q& w1 S. A  Y2 ~, u( UAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。& ]; f9 f# _! F/ N- z* v0 u
: u* N  d& v! n5 f0 \2 X- @
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ H* h$ [2 T5 p  \7 O# b+ ^4 D1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
( s* g' h* V, _* Q' Y2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
1 D+ R4 Y& [1 L: l! z3 ~3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
8 d- \3 z( ^  I" E  i" U. z; A8 g$ vbegin P_induction arriving
5 O: B6 h. Y6 @) `* Y5 {4 F) u/ H    clone 1 load to P_pick(A_induct)
$ D# S5 G% k! M8 l, {; Q% `; bend最大的系
4 z; z. }  F+ e' [* h- U6 K; [! V
' W) F5 Z: p! E- v- x8 `( Xbegin P_pick arriving
* j: K; y) |* C; R" Y8 O) P    set A_i to procindex * 10 + 1
  L: W) u. s, k) S    move into Q_induct(procindex)
0 x/ }6 E9 u" {0 U' O4 `    move into pickaisle.induct(procindex)
0 b* s6 }1 B3 B" T! v3 N/ v    /*check the type of pickaisle.induct(i), for your last problem.*/$ b0 A) j$ Z) \5 J( e

" E6 h3 k3 Y) }' ~0 R    while A_i<=30 do begin
, ]  ^1 [4 Z' s3 @. _) C/ E) ]        travel to pickaisle.con(A_i)
- |) O5 p7 F" p0 @; R: d* i- E# l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ q# R2 C4 }& t        else wait for 10 sec
& e1 I( L9 B2 t) x9 G        if A_i=A_leave then send to die
/ i8 K  t2 |# A) f" R0 _        else inc A_i by 17 x& J4 K/ j' O( m
    end0 V/ U; g. G" B* c2 s' m
end
1 u( M6 l5 S( ~/ _) _$ c0 G" k. D2 P" b, k# n$ q, ^4 d
其中的procindex为整形,代表当前process的序号。$ Y1 z+ O( I' s# {. m* p; v
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, 2025-6-2 13:14 , Processed in 0.015318 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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