设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13121|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 i6 u! f) F8 }0 B. p8 Y
3 @6 O) X8 {; L5 P2 j  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中的数值,不知道会不会有什么不妥。
4 z) Y6 S! {! _" W% v1 s! U5 K$ B- W
begin P_read arriving. N. b# U# e9 {2 A5 @
    while 1=1 do begin( M8 |$ C( v% l+ k# z
        read A_tote from "data.txt" with delimiter "\n"3 P% ]: L; @# k( u3 R- U4 b# N: T
        read A_time from "data.txt" with delimiter "\n"
) k. `3 K- ~, X1 l        read A_leave from "data.txt" with delimiter "\n"( [; ?9 {4 r- L8 c5 U' |2 q6 ^& |1 O
        read A_picks from "data.txt" with delimiter "\n"/ i/ E) a! V: C- a5 V: n; v
        set load type to A_tote
! B6 `6 Q, @" v# f; i4 p        if A_tote="tote 1" then set A_induct to 1
0 S4 j+ Y* Q" q' `        else if A_tote="tote 2" then set A_induct to 2$ P( a( ?0 O: ]+ v! D
            else set A_induct to 3   
, A+ ^3 ?1 d' ]( ^        set A_i to 0
( J( d3 m3 V5 H; k6 J' h4 ^; ~        clone 1 load to P_induction/ S# d' e# R' q( E8 n  E4 j6 \- Q
        wait for A_time sec8 x6 s/ Z5 g/ g1 H- r& S
    end
7 W- K* {/ y  A9 W  Gend
/ I3 V- E7 j' i- T! p- e& V; N( }6 F  g7 S
begin P_induction arriving) c3 {* U8 N% G; F: S) n
    if A_induct=1 then clone 1 load to P_pick18 ]' A! j" l8 q; N
    else if A_induct=2 then clone 1 load to P_pick2  ]% r9 T" U( L: n0 k7 {" t2 j
        else clone 1 load to P_pick3" n* J! a: T/ h6 ^  A1 a
end
5 [  y! B6 C0 ?5 q# @( W
: ^/ j- r! ?/ x+ d3 {2 T* h; Jbegin P_pick1 arriving
3 R' f: y- G8 P8 R    set A_i to 1% ?8 V7 K, q) }3 m3 L5 p  n
    move into Q_induct1: [3 s. v: N' F9 S0 Y  u$ q
    move into pickaisle.induct18 u6 [( S" `( Z/ c& x
    while A_i<=30 do begin
8 i0 C2 h) P. q2 L2 I+ f* M; N) q5 r1 z        travel to pickaisle.con(A_i)1 @. s% `. M' y( w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) R) Z: g" f$ B( a& O        else wait for 10 sec
8 t. s: ?. F3 G        if A_i=A_leave then send to die
' Z, `" X" \/ q. L" |5 ^; P! @        else inc A_i by 1/ I) \- z, V& ]2 P3 o5 J$ m9 [
    end
1 b3 f+ o/ n% yend
) Q/ U/ {7 e$ ~% L& x0 `+ Q5 g6 n& _1 ~. f
begin P_pick2 arriving
$ p$ H/ F, w* x, G0 A5 A7 P1 `    set A_i to 11
+ E0 t5 F0 _' ~" D" F- {    move into Q_induct2  |/ @- `( G& c2 C+ C' U
    move into pickaisle.induct2
% c$ a$ e2 E) O3 g    while A_i<=30 do begin) Z$ U( o( j+ M% T% m9 u1 ]
        travel to pickaisle.con(A_i)* A0 }5 ]2 e! u; I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 T4 s6 M4 _  y        else wait for 10 sec0 _- Q" n8 }" @: J/ E/ c
        if A_i=A_leave then send to die
  K5 N9 P/ b. F& m: w        else inc A_i by 16 J: H6 R9 F# i1 Q- m
    end
. C; K3 o4 d5 r. F9 T- r, h* Nend) [  q, ]) h9 S# H
# b) Q  Z5 H, w/ A+ B! K/ J- T2 O
begin P_pick3 arriving+ p% f3 M. m9 E8 f8 j- c
    set A_i to 21/ j3 D# V: V. ?1 @4 H
    move into Q_induct34 s5 E* S9 {/ T( @* [( z# k3 x) Q
    move into pickaisle.induct3
: |" Z5 s% z' w5 b  ?. C  Z: g0 ]    while A_i<=30 do begin
8 y& t; w- L/ m) `- I        travel to pickaisle.con(A_i)/ S  l$ z# z5 v' {# o6 Z& ]/ |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" N  y% O3 ~  N, @        else wait for 10 sec" _' b# D1 A+ x
        if A_i=A_leave then send to die7 u: G7 V/ I  \6 ]: b
        else inc A_i by 1; Q/ I( b& p: x: E! z& s
    end
& W; |7 f9 ]! T3 V; R, Q* s6 B( Vend

最佳答案

查看完整内容

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是个什么东东?0 a" G7 e: O1 i: F# ~, G
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?2 l* o* O. {4 P" W- V" D. a  v

) G: z2 R  ~; N; h- A0 tAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
& b! i1 T) Z4 ^  _. l! M; k4 N$ G4 y" J. n" x! Q. {  B( \
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  w" {0 |( r' p, ~& Z) H2 @* T5 o/ f1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
) L5 k$ I- @4 i. l7 K$ Q/ N$ d2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;% G3 W# L( }2 F3 t, H
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:% }% r# p, {- _7 h) T
begin P_induction arriving
! J9 v, T5 C  N- p  f% U7 t    clone 1 load to P_pick(A_induct)  M+ L+ U3 M) o/ w" s1 _
end最大的系
9 h& m  ^5 G$ p+ l; d9 P2 E+ x' D/ I( e7 M; f
begin P_pick arriving5 g7 P. T) X3 b7 [
    set A_i to procindex * 10 + 1
$ n  E7 d( e* W; Y' l: |& C    move into Q_induct(procindex)4 {* }; b* S8 D$ a* v
    move into pickaisle.induct(procindex)  W1 {( K$ s1 G: I# N5 S  U2 u
    /*check the type of pickaisle.induct(i), for your last problem.*/& H& Y! V  d$ @% t+ |& _& J2 Q
! l; f8 \+ v" d( x" L9 ^5 q
    while A_i<=30 do begin
$ Y# ~2 O& \9 K- q1 ?9 n8 [        travel to pickaisle.con(A_i)
' X8 b3 L% i+ \) d6 ]! U( j+ `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& J2 y7 p0 N5 O1 z3 [        else wait for 10 sec$ ^, [# F) i7 f9 Q6 o' G
        if A_i=A_leave then send to die+ X5 S% E# k# O' _4 _) S' d
        else inc A_i by 1
9 M( a# K( q6 L. A    end1 j/ c' v, Z2 l( M- A1 @
end
  h: _/ o3 j1 \4 n  I
( t" i6 a; S5 y1 A7 b1 c其中的procindex为整形,代表当前process的序号。! g. x/ Z" K2 U. `
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-3-20 14:13 , Processed in 0.018019 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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