设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12592|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 |, ?6 r2 `  m; D
* S8 v7 x' b+ q3 Y/ D. q! O
我的问题是,在每个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中的数值,不知道会不会有什么不妥。. D! }9 a7 G  ^! t% u* S2 t

2 O3 U0 i* A# s5 ybegin P_read arriving6 V6 U& l; v, @/ \) F
    while 1=1 do begin) l+ e4 }4 s; e  o- F7 `. o$ ^
        read A_tote from "data.txt" with delimiter "\n"% W, k% T3 w3 C$ c9 R: r$ H3 t4 F$ x
        read A_time from "data.txt" with delimiter "\n"9 D  b* ~, A; }9 R
        read A_leave from "data.txt" with delimiter "\n"
8 G) x& q4 }8 F4 S; M        read A_picks from "data.txt" with delimiter "\n"% r$ O7 M( a' u, W
        set load type to A_tote; t( K# M5 w& q% ^6 w3 L
        if A_tote="tote 1" then set A_induct to 1# A( b; D( K" X$ C/ O& `8 N- \
        else if A_tote="tote 2" then set A_induct to 28 \+ W$ W! n' u1 Y9 S0 u
            else set A_induct to 3   
' \+ N/ Y% [6 C! z6 l5 A        set A_i to 0
: Y2 [0 @% Z0 \3 {: s& Z3 _. x        clone 1 load to P_induction* u/ Z* V/ m& W4 U5 ^1 \1 b' |' q4 R
        wait for A_time sec
5 ?( q" T) }. g    end
% G+ w2 a2 v0 l: \3 a) tend
1 C  _0 q1 D) W( I
. [5 e4 s! F/ u/ x7 rbegin P_induction arriving$ L  L% b- ^  O' O
    if A_induct=1 then clone 1 load to P_pick1
2 ~. R( b# b9 ?% i9 W  [" e7 k    else if A_induct=2 then clone 1 load to P_pick2
4 r: p. L+ i  r1 `" ]        else clone 1 load to P_pick3% \" v0 h, G+ }. a+ c6 b
end6 c9 o, s4 @% c* P

# w' d0 i) X4 a' L2 K. vbegin P_pick1 arriving* O5 D7 ~) h0 O# b
    set A_i to 1
# }9 f+ ?5 S; `' V; p    move into Q_induct1
0 p1 m+ ]4 U$ d. Z; ]    move into pickaisle.induct17 l! V& s, @1 H0 E& f* u4 K" Q5 G
    while A_i<=30 do begin5 i( ~( N0 ?, Z+ @0 c( T
        travel to pickaisle.con(A_i)7 |9 R4 d3 W1 R. u9 X) e+ D/ d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* _7 H7 z7 c' H: t  C, E% V        else wait for 10 sec5 C( ?) w1 F7 N# L+ `: z
        if A_i=A_leave then send to die
1 A# f) U3 k5 ?0 ]; d% ^        else inc A_i by 1, b7 G( N: }9 \2 n
    end
  L+ ^/ _0 N8 G7 K$ C+ Iend* N: t, C6 l: W$ n8 L: b

( l0 \3 V' c. V& Tbegin P_pick2 arriving
" D$ Q' A7 z# t. `    set A_i to 11
$ T0 y- T$ l  L8 O% c: x& ^    move into Q_induct25 N" E9 Q: w% y% R4 x  H) u9 {7 r
    move into pickaisle.induct29 ]# D3 B7 e. ]: J; g3 v$ l2 W
    while A_i<=30 do begin
) X8 y7 m5 n+ f+ U1 s6 w        travel to pickaisle.con(A_i)! L, o( i' F1 H4 {( L: _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 h9 G; A2 n# {8 A/ _7 f        else wait for 10 sec2 |* |' }  p+ Y1 [
        if A_i=A_leave then send to die
% b# g  P+ }& U; a; p9 V5 {" @        else inc A_i by 1# V- W. t" c2 y6 _# c
    end9 J: K" {6 K  {/ U: B4 ?" H9 a
end) D6 g9 ~( g3 w

( R+ K1 I8 D5 p) K9 O7 l% R1 ~begin P_pick3 arriving
3 U8 d" l- }* w2 x' e6 e) ^    set A_i to 219 ^8 Z# Q: p" h; g. a9 z
    move into Q_induct3: p+ y, @5 U- L  K0 l& a
    move into pickaisle.induct31 G& ^, O% K' N! B
    while A_i<=30 do begin0 m# R2 e2 F: Z# Q2 K  ?! e2 `
        travel to pickaisle.con(A_i)
# `8 I# J$ O, T, s1 x' Z; N, k! h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! c, [1 W3 i% g5 T
        else wait for 10 sec
$ ?5 T0 Y1 T7 q" I% O: G+ L# q+ p        if A_i=A_leave then send to die1 D1 B! z' r5 `) Q
        else inc A_i by 1
8 x7 j/ X& W' |  S    end, X' R3 @4 [& S7 A4 l( E- |8 e
end

最佳答案

查看完整内容

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是个什么东东?
# n: i! A' S8 H+ ~# J  Ymove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?: K9 A- `9 l+ l3 D0 [5 ]" G# X
; k# `! b+ o: d1 \' l9 o0 h; A
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。, Q! k1 C" t# ~2 B4 U- r1 v0 P5 Z

8 S& E' S) h+ b  q另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:' v0 o- K1 \% S' B$ l
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;: X" e. A9 A6 ~6 ?  Z5 @9 I
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" T7 O2 d5 r) F8 c# t" I! x& B3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:- m7 L% S+ ]/ X; _' y
begin P_induction arriving, b0 ^* `! ?4 l# h! g# K: X
    clone 1 load to P_pick(A_induct)
' s7 Q) c0 x" w" {! s# uend最大的系
$ M3 o7 Q- ]! [; X. Y
+ m# h+ k, S$ g& h# lbegin P_pick arriving
: C$ A: H( r, N6 g* s) N- K    set A_i to procindex * 10 + 1
3 P7 N" b( L* B9 V3 w6 o    move into Q_induct(procindex)
; }0 q: F, `$ a4 s: |$ q7 G$ i    move into pickaisle.induct(procindex), a: X; k4 |' g7 }
    /*check the type of pickaisle.induct(i), for your last problem.*/: `7 x6 p8 W7 W: W

1 }) l0 t. S6 E$ N" W    while A_i<=30 do begin
2 t3 b4 a7 ^6 {! D' k  @) a3 q        travel to pickaisle.con(A_i)
) ?9 B+ t- k( z- V+ B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" r- |( B& ^/ @; q! E        else wait for 10 sec
$ k$ c/ X7 S& F: O9 c$ I        if A_i=A_leave then send to die
# Y  t# X( z$ U7 r! n4 o        else inc A_i by 15 Z' y9 [( ~% m$ L  k
    end
, Q( H8 o# g! L- v% K' H# {end2 t' N8 P" M0 q% [
+ u$ a+ D8 I- ^, z" x$ l9 [" I
其中的procindex为整形,代表当前process的序号。9 b" i* t8 f/ o# M9 [5 }7 [4 W
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-2-3 14:10 , Processed in 0.020249 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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