设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14318|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! p* i# s( x  Z3 f1 V# S

+ p- {4 N$ K; |; V  w" f; R  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中的数值,不知道会不会有什么不妥。
) V3 A0 _' J7 m& S. P1 r
7 u$ @+ }' G, a9 F# Fbegin P_read arriving. T( A& ~$ ^/ @: |+ D: l
    while 1=1 do begin
- F: a: r$ L" }7 J        read A_tote from "data.txt" with delimiter "\n") I; v, B/ j& I
        read A_time from "data.txt" with delimiter "\n"8 R! O& O# d/ @: z! {: s- G* @
        read A_leave from "data.txt" with delimiter "\n"0 h: d( W! ^' p8 Z# M( m
        read A_picks from "data.txt" with delimiter "\n"
6 O; i+ Z% V2 _& v1 _  ^2 v( x        set load type to A_tote
  I6 I) E+ y% s4 ?+ H        if A_tote="tote 1" then set A_induct to 12 U% l5 O  [1 K5 `- i
        else if A_tote="tote 2" then set A_induct to 2# e( z- r+ q& C1 o5 h; n
            else set A_induct to 3   
) \) p5 H5 r9 p2 N        set A_i to 0/ r4 a% l3 z& V! y4 j7 \
        clone 1 load to P_induction; J& W! Y3 @# R/ ]
        wait for A_time sec
% n9 t% r+ m5 V' {5 z, x    end4 G. m' R3 J, ?6 |2 f, a' ]) X
end# G  J4 \5 i& U9 t9 N& U

, Z7 e' ^4 b& i6 wbegin P_induction arriving& k# \$ R% z/ \/ u$ \9 V
    if A_induct=1 then clone 1 load to P_pick1% E- C& t2 x5 u: K0 P
    else if A_induct=2 then clone 1 load to P_pick2) p) }3 d) ?( Z) z
        else clone 1 load to P_pick35 i" ?4 q5 Y. G5 ~
end
( S" l, j- c- P6 l6 Z5 S1 g6 @# S" J( Z9 P( H- A- R
begin P_pick1 arriving
- J4 Y* n) k( E6 }; `    set A_i to 1- T" I4 R# }0 ]8 b3 G% v# _
    move into Q_induct1! L$ t: c1 E8 {8 d9 k, t+ h& @2 u4 T
    move into pickaisle.induct1, l3 d, u2 k# w
    while A_i<=30 do begin6 w2 z. q* p, ^, X, X
        travel to pickaisle.con(A_i); @* ^5 P; {( B/ Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 v  T6 w9 e' o/ @8 t
        else wait for 10 sec
  M) v$ S, ~4 @; H        if A_i=A_leave then send to die
5 B3 p6 U& s0 P- f3 P1 G' H$ e        else inc A_i by 1
1 [1 l0 z' p2 [: `. z    end  U# @2 V. J1 x
end
' q1 }8 k( P! [" ]2 R0 J% L# }% O) _3 `( n7 E6 r
begin P_pick2 arriving$ \* L, @  [2 w9 P
    set A_i to 11  [% C4 Z  K# V4 Y$ Y1 b
    move into Q_induct2$ {4 i# Y: J: r5 o' h6 `+ Y
    move into pickaisle.induct24 L* c/ n" z4 z% D
    while A_i<=30 do begin3 Z% g! J6 x, d  k  A3 f; r0 P8 p
        travel to pickaisle.con(A_i), x7 |) c) G( I4 `) ]/ n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  y+ [# L; W- G/ N: y4 F5 K
        else wait for 10 sec$ Y) P* E( ^1 W' ^! @
        if A_i=A_leave then send to die/ N. P0 e1 G& U
        else inc A_i by 1
! l2 B! K8 p2 \; B" k+ l- ?3 P! K    end
, |. w& A: x' P3 @end' C/ D9 }1 B' j( S3 r; A

8 g0 H/ Z/ @/ R( V- Tbegin P_pick3 arriving
+ x) {9 A2 |) g. b) A/ ^9 `- E5 r7 C7 N    set A_i to 21
0 p' \# K  u7 v- r2 A8 B    move into Q_induct3% u- T* s$ Y5 g! W
    move into pickaisle.induct34 {3 u; e$ L' `2 M& V2 z" Y. T
    while A_i<=30 do begin1 z2 K/ L5 A( m
        travel to pickaisle.con(A_i)
$ W) L: y& l9 l1 u2 d- q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) r/ W7 `% B3 t$ R; e1 I
        else wait for 10 sec4 P' B& ~5 f; @2 h! h/ w% W. ?; f
        if A_i=A_leave then send to die
% h/ u. R& Z; A  N% x+ {        else inc A_i by 1
5 d: ]! X: A: w  s" N4 G    end
" O3 y) n# P% u& F8 c1 e9 \+ Jend

最佳答案

查看完整内容

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是个什么东东?
9 @6 k+ z) I) o( O0 q4 q" s' Cmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?9 Y- Y* P, F& W- Z2 k
" E4 Q2 I9 u# X7 j' F
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
0 G" O4 s  Z* U, g0 \, ]4 [6 a2 H( P5 L! w  W
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
! a% Z& y; F6 C5 f/ C1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
+ m( o( _/ A; A2 J5 R2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ c. O% I( e/ z( Z4 ?1 Q' Q3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 v0 j  F* W/ C2 ^+ E! ]7 }' l
begin P_induction arriving/ ~  w8 F% s: K& s+ a2 F
    clone 1 load to P_pick(A_induct)3 C; M- ]( v4 p7 q$ ?; j$ @
end最大的系
/ D4 i; G, J- b4 Q0 ~% s" y: w, w/ l1 j+ i3 L% Q( r* r
begin P_pick arriving/ O2 }3 Q' H1 L+ n
    set A_i to procindex * 10 + 1
# y9 z( n* ~  G* b" E) p    move into Q_induct(procindex)
8 w% N8 O4 M7 O) `( @$ B    move into pickaisle.induct(procindex)4 k) |- P2 k; o  i" o
    /*check the type of pickaisle.induct(i), for your last problem.*/2 d7 l* o7 b4 F9 J+ o
9 o% @( q  y7 S" m# R
    while A_i<=30 do begin0 t6 o# O& ?: u6 v
        travel to pickaisle.con(A_i)1 _1 C4 I( j  T$ @; a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% y$ r+ O$ V, ?" E& [5 i        else wait for 10 sec
  c' l0 l5 p3 p+ \        if A_i=A_leave then send to die
; i2 o/ W" l6 Q  r  w0 h, G4 v- _; \        else inc A_i by 15 _, {0 [& k0 m; h5 ?
    end7 U& _4 T) Q' @2 r: f
end
, n$ h7 F0 R$ x/ ?7 B4 d. `# t$ u7 Y$ @* X; d
其中的procindex为整形,代表当前process的序号。
8 i3 x. `( J2 N! ystation和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-2 07:38 , Processed in 0.015225 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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