设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14270|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 c9 ]5 [, n) ?! |- E) q
3 Y" z& L/ w5 f# n我的问题是,在每个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中的数值,不知道会不会有什么不妥。
. ^5 \- q, m- }6 H# {4 b0 V; O3 x. v0 G" C- z: ?' A
begin P_read arriving% W/ w6 F. k- l8 V' n: w
    while 1=1 do begin
5 Y, b' C5 A- @; m( D        read A_tote from "data.txt" with delimiter "\n"' p7 S' y( ^- L; u1 K+ n' b
        read A_time from "data.txt" with delimiter "\n"6 R& D) u: M; m2 m* t9 g# P
        read A_leave from "data.txt" with delimiter "\n"
3 C, u2 S6 N5 c2 G/ E7 c1 `        read A_picks from "data.txt" with delimiter "\n"
4 N# e. H: o' W        set load type to A_tote7 H* q4 M' ?( Q
        if A_tote="tote 1" then set A_induct to 11 c- Y' S, w% x, O/ F
        else if A_tote="tote 2" then set A_induct to 2
5 W- s% `( |0 u  o" v            else set A_induct to 3    ! b+ r" {: r  F6 g  g. |* a
        set A_i to 0% {. ~) L9 H9 S" ~
        clone 1 load to P_induction0 E+ N. l! v3 B/ Z! }$ `
        wait for A_time sec# ~: R8 ^$ Q0 d) u5 ~* |2 c- f
    end2 ~2 B, \# f# T& P0 A; A
end0 ~( `- e6 M0 X& L% f

8 X' b* q8 R" B, b6 U: P/ h$ xbegin P_induction arriving
( @# T" F- f! j    if A_induct=1 then clone 1 load to P_pick14 V" A+ S7 p# v* b3 |6 M( @& V% R
    else if A_induct=2 then clone 1 load to P_pick2
' H( s3 {% Q- s4 J        else clone 1 load to P_pick3
5 T# E5 y5 P9 _0 `' s4 ~3 Uend
, a& R! L- C/ `) K4 K- Q1 J" r" }
5 B" V" I! i: Ybegin P_pick1 arriving  o9 L' B5 }  v( w
    set A_i to 1
) S) S3 x. s* a; B, S    move into Q_induct1
/ F" b0 T3 L+ ]4 v4 s6 z& s) |    move into pickaisle.induct1
  d# g  z7 H( B6 w) ?7 u7 j3 \9 o    while A_i<=30 do begin
, @+ c$ `% u8 u( `6 e+ |        travel to pickaisle.con(A_i); w8 i6 k4 k3 |5 i1 x  f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  S! x0 a8 w# ?+ {& L+ Z. G        else wait for 10 sec
0 u, h& r$ ]6 H# j  V& ~        if A_i=A_leave then send to die
. s% Z) _/ X0 L6 H0 ?4 t        else inc A_i by 1
( u. ]5 s6 Z7 z# D; i+ r' ?+ N    end  @6 _! l% e- L, g
end
+ p- i2 m7 h! p' ~4 L8 c+ W2 _
2 d' a. f9 Y' T8 ~begin P_pick2 arriving
8 p1 H: d2 ]: U( x& I. v    set A_i to 11( n1 a2 V, H6 w9 p( H/ S
    move into Q_induct2
1 A. U; t$ _( u( q) \    move into pickaisle.induct2. E8 E8 ^6 v* }- Q# o" f
    while A_i<=30 do begin
1 S! f3 V  }. v8 Z/ P' v; O        travel to pickaisle.con(A_i)
" j4 _  q! g9 L/ o) s% O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! P' A- c/ R. K$ y: \( g- [
        else wait for 10 sec3 u0 Y' C, D; M9 X3 D) j
        if A_i=A_leave then send to die
8 P9 n- o3 S& P3 s) e7 f        else inc A_i by 16 D! \/ E7 D8 k# N5 O
    end" P! v9 X& w- {: Z! i
end1 _' G* d& v6 d$ e
9 {, g% ?9 y- X- y
begin P_pick3 arriving
" z; K+ z5 C4 _) P    set A_i to 210 e" w  M3 T& c- E+ K( Y/ J
    move into Q_induct3
& p# \  z. e9 @  Q7 y    move into pickaisle.induct3
( `% _7 m1 e! o. `" H7 R    while A_i<=30 do begin7 [3 R5 X7 [! @7 A
        travel to pickaisle.con(A_i)
+ F) v9 m$ r1 e' k6 _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 p& z' K. D( V$ r8 ~% [! h
        else wait for 10 sec0 `4 J- Y! m- G# h: g2 O7 m& W5 z
        if A_i=A_leave then send to die, h* D7 [& f- ]4 T6 t" K
        else inc A_i by 1
. h  v  n) a0 M8 j2 l% `0 w# c    end
+ a0 [* p2 o, H, rend

最佳答案

查看完整内容

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是个什么东东?
) m9 h7 H8 B, m5 hmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
, W, Y7 \# E4 r; E5 m- c, z  X9 ^, d. y
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
( {0 _/ c6 `$ ?( V6 p7 z: ?9 F: H2 p. O( T# R
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:- _, ?6 x$ ^: \/ b
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;9 V. f1 Q: p6 n5 Y
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
! f2 Y7 `1 R# B4 \& M; v+ w" d3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:/ s/ E$ }5 m$ n& x3 {, ?
begin P_induction arriving
, U! f4 f) r; D% l: Y/ }% n    clone 1 load to P_pick(A_induct): R1 j0 ~- Z. A7 ^  q6 j
end最大的系
) q# m" c" z+ [0 L
  c2 Y' Z, P' D6 U5 `' R/ Wbegin P_pick arriving. X( [& i6 O3 E& s2 V
    set A_i to procindex * 10 + 1
, a5 o7 {: ]- t+ }, n; P    move into Q_induct(procindex), J# _1 {# S" K
    move into pickaisle.induct(procindex)
) ]' w. x+ F3 A7 ?" j- Y    /*check the type of pickaisle.induct(i), for your last problem.*/
+ r& w( M7 M, u) f7 n: Q, C! I# [) u% P& n* f
    while A_i<=30 do begin
% T9 G& f; H* t$ _# i* r3 p6 ^        travel to pickaisle.con(A_i): d1 n2 Y$ A- y1 p9 K: x$ I6 r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 ?; f5 q  v: Q5 l3 K! S: e9 Q
        else wait for 10 sec
5 {9 ?+ s" p! `! _5 P        if A_i=A_leave then send to die$ p5 M- Q( R! S$ }- T/ H3 y# L
        else inc A_i by 1
2 h2 e3 O) Q% p/ L3 S, S6 W; M1 A    end5 J$ ~5 u# x/ K) |; J# e0 R( x
end
; e1 l7 X" D/ J
9 n' T4 i1 n: V% Q1 y其中的procindex为整形,代表当前process的序号。% x; ^- ^0 }5 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-6-26 13:01 , Processed in 0.018228 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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