设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15041|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( L7 [3 s- y! E) w! \  D* W
" c/ B# |2 M; Y% P" P- B0 a我的问题是,在每个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中的数值,不知道会不会有什么不妥。1 j4 l9 X( y2 w  i' W# r# m

; E; t1 Y! g6 D3 q6 rbegin P_read arriving+ P% C2 A% E0 w5 A
    while 1=1 do begin
0 `7 Z1 t; U- {6 p3 O4 C' V        read A_tote from "data.txt" with delimiter "\n"
+ x) C1 O4 m  W7 L6 T* \        read A_time from "data.txt" with delimiter "\n"
; }0 j2 K+ z$ C' |9 y        read A_leave from "data.txt" with delimiter "\n"6 Y( g  f7 n# ]4 G. {4 s
        read A_picks from "data.txt" with delimiter "\n"- z6 R" v# g: u  F3 T. {/ l4 A9 C. _
        set load type to A_tote" w/ i& f; L6 P8 I& D! C0 k: c! C
        if A_tote="tote 1" then set A_induct to 1
* v7 H4 R, N; d7 Y' P        else if A_tote="tote 2" then set A_induct to 2$ s% r! s" o3 J& Z! r
            else set A_induct to 3   
4 }# j% L, k3 b4 o" \5 {. p6 Z        set A_i to 0
( \" o& Q8 F8 l) W" U2 T8 t        clone 1 load to P_induction9 \# a# k! P/ }6 q
        wait for A_time sec, c: R  _0 o* U% ]
    end
( u( H/ o6 `& y! t0 r3 h- Pend
! W' m6 ?  }/ i2 I" `; h9 \  g, Z) N3 Y; e4 r
begin P_induction arriving! H* J6 I* h6 k& f
    if A_induct=1 then clone 1 load to P_pick17 f% ?4 M8 M+ L0 V; I/ w. j( L0 K6 a
    else if A_induct=2 then clone 1 load to P_pick2
# u# s' X& t' ~1 `4 h6 a        else clone 1 load to P_pick3- S: m9 e/ S( b& ]8 E  g
end( S) z, `/ Y$ ?% c
5 ?% a; |7 C9 s" q
begin P_pick1 arriving7 c4 Z: ~6 F' J: ~
    set A_i to 1
+ b+ E/ z* J9 L# A5 [' j6 k% s    move into Q_induct1# @; T2 a/ B, R! m
    move into pickaisle.induct19 |" @+ @" ]# Q  @# ]5 \- H
    while A_i<=30 do begin% D) ]9 n- a% t2 }$ J* z
        travel to pickaisle.con(A_i)7 S# V) o- M0 q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* C0 b1 B# |& R1 ?
        else wait for 10 sec7 r+ I0 t% p9 c! Z5 {2 D/ p
        if A_i=A_leave then send to die
8 {. P, u, S/ a& y: @2 q        else inc A_i by 1
% G) A7 E9 m8 j3 d    end) {% X) f' d: ~' X8 `
end/ V& A9 n8 D" ]0 X$ ]

/ F5 B) U& P' ?begin P_pick2 arriving
4 ^! F$ b$ ~$ V2 r1 F  d# k8 g    set A_i to 110 \: ]% V, M! G/ `1 ~' i% D& {
    move into Q_induct2
2 v2 X9 A3 q1 I. {    move into pickaisle.induct2
6 n# v: O2 s; U    while A_i<=30 do begin. n& a- Y3 O* ^7 R
        travel to pickaisle.con(A_i)% q0 }: D& J+ W' s2 d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; d5 ?' c" k# @- T5 h. r+ e        else wait for 10 sec
/ T; p; P/ b+ [, O. k) X        if A_i=A_leave then send to die
, \* _1 }& S% X% ^9 [  K8 N        else inc A_i by 1
4 W- l& I0 R* m$ w, b, b% V) {    end$ R% B3 m6 v9 w9 V, |2 O. ^
end
; I$ N$ i3 n5 y) ~) y1 C0 d5 `: E7 F7 `& w
begin P_pick3 arriving
7 Q% x6 }2 Q) z) |6 D" [; ^    set A_i to 21
' a7 B: |0 t; [  H' S    move into Q_induct31 L+ C$ P2 v- k' v4 ]& n
    move into pickaisle.induct3: @6 ^' w' d: s9 o. K9 o
    while A_i<=30 do begin
* S/ A2 v* k! m" T& w        travel to pickaisle.con(A_i)# E! }/ D- p0 o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 a5 u2 z8 q8 ?. H1 F) Y
        else wait for 10 sec+ ]7 Z5 u& a$ `" J+ H
        if A_i=A_leave then send to die
2 d1 X0 g; x9 U; K        else inc A_i by 1
% t- J- Q7 D- a+ S7 F3 r5 G    end
. z; N# F3 U7 l: K- y2 xend

最佳答案

查看完整内容

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是个什么东东?
7 `5 D" J+ Q3 j5 ?. f% L- Smove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?7 a' E4 Q* K& l0 J4 |" Z2 k4 ?
2 @8 s1 G/ o, e+ u) K
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。; y7 V2 {  g# j

" Q3 l  i/ N- A8 o另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
9 }( V; p$ v% L+ A' _+ i" L( E" u1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
5 e& ?1 P) o) m% l1 [+ {! X2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: E( |1 V' ?( j1 T3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:8 L0 q2 n9 j2 [% k. `% J
begin P_induction arriving0 X. V+ r: y3 ]6 m  j
    clone 1 load to P_pick(A_induct)" [# h# P0 g, ?
end最大的系  b# E  H, l1 q  N8 \
; @% N, j' f" A3 d% y0 z8 k0 @5 `
begin P_pick arriving
0 w$ Z7 F% G+ k: W& _$ _( U    set A_i to procindex * 10 + 1; P. B4 e0 \3 ]8 J6 J2 i  i$ Y' F
    move into Q_induct(procindex)9 |" ~1 p: h# q6 _& O
    move into pickaisle.induct(procindex)
+ b. Q3 K! S( o# e# `    /*check the type of pickaisle.induct(i), for your last problem.*/
% U% D" m2 u8 C0 U; w6 ~$ _
! q; V' V0 I! B0 Q  {  `    while A_i<=30 do begin& M, w% S0 H: [# _3 A& R
        travel to pickaisle.con(A_i)# r5 t& p* X# ?& |- y' Y3 V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 N5 s9 k7 D. n, b        else wait for 10 sec+ |; O! X, H6 h& B$ R
        if A_i=A_leave then send to die+ Z$ X  `, S, |' Y1 v
        else inc A_i by 1% @' f2 X& b- P% P7 b0 S6 l
    end1 e/ h/ Q( G) z0 {9 {+ W' H. A
end, t1 Z( M2 A5 G2 {5 k) _; x8 {
7 S  U+ W% K8 x; u* c) W/ Y
其中的procindex为整形,代表当前process的序号。- Q5 d1 u$ Y" D) H6 C
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-5 22:05 , Processed in 0.013646 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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