设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13964|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
  M( t9 }, R. r& _$ r/ f
' `1 @) Y2 q4 G4 t( ~2 @% V* J! }我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 w" |  F# r. J, E: e4 \
' G8 b% p* s% A% e1 l: I; ^0 s( ]: x9 sbegin P_read arriving
: _6 N, {, X2 l! f' N/ W' \% D) L    while 1=1 do begin
  W9 |, }1 K  E6 J        read A_tote from "data.txt" with delimiter "\n"( d5 n, V8 }% B! f* _( _' V
        read A_time from "data.txt" with delimiter "\n"
, i$ j' P7 i0 X" Q& q4 b        read A_leave from "data.txt" with delimiter "\n". o8 o* T- v2 o" H; F- n
        read A_picks from "data.txt" with delimiter "\n"  e7 C& J9 j0 ~& \6 w+ _
        set load type to A_tote, R% o* J+ O( z# R" u4 ]. n  I
        if A_tote="tote 1" then set A_induct to 14 E/ ^5 K1 I' s
        else if A_tote="tote 2" then set A_induct to 2
/ p$ A# r! _# U) D            else set A_induct to 3   
% [+ D, }* w% g        set A_i to 0) a. g' P; b/ z$ m' i  G, m( e9 W) Q
        clone 1 load to P_induction  A( x1 G% v# p& j$ k( e
        wait for A_time sec& J2 P2 ]6 I$ I8 v! U) n
    end  b. G  S, t" w1 e) i- ?
end0 y* ~8 |5 M, Q* V( f" Q' I

8 j7 A# r5 a! g( x8 `2 f' ~begin P_induction arriving
0 d" e2 D1 I! h: N  E" h/ E    if A_induct=1 then clone 1 load to P_pick1$ o' G3 j* J4 a' h/ n! `
    else if A_induct=2 then clone 1 load to P_pick26 v+ e/ ~9 ^0 s( k1 n3 |
        else clone 1 load to P_pick3( B2 L8 x: c& `% I4 b. d
end
* X$ N& o( l0 x+ e2 I' y. i( I5 v' R& [* Y, H& v  f
begin P_pick1 arriving
* v3 c5 D: g# a6 n    set A_i to 1. |; Y. n# M( J& A7 W
    move into Q_induct12 B4 o, U4 u; Z8 Z
    move into pickaisle.induct1
6 H& G1 H0 _0 {' D5 L    while A_i<=30 do begin- z; E4 Z- L) k, d
        travel to pickaisle.con(A_i)
- Z4 \: {5 k2 {1 ?( X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" D/ {  r3 H; n0 Q2 I
        else wait for 10 sec2 }0 ~; f1 K' t" |
        if A_i=A_leave then send to die
. n' i* f* @3 |) P8 B1 s- O        else inc A_i by 1
2 B$ c1 |& l  ^9 }5 S+ h6 K    end
8 y; \" q  _$ X' n& xend$ \( q. D% C. u* A! K$ w
6 U% [; @6 k1 f6 I
begin P_pick2 arriving% X3 h4 l8 F  p" E: ~
    set A_i to 11
2 c0 ^2 h7 L  ?2 q5 U* a  ^- f    move into Q_induct2) s7 S4 t& s3 X$ `0 g
    move into pickaisle.induct2. E1 [/ v. X& R' p0 f
    while A_i<=30 do begin
# X$ u& h% |: R9 ^        travel to pickaisle.con(A_i)' W/ L' g2 b, P: \' n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 P1 O0 r0 E: L3 f5 M& R6 R
        else wait for 10 sec
8 H$ c! R& Z8 @/ O. q! a        if A_i=A_leave then send to die/ G! S% v3 t+ J8 a+ Q& O
        else inc A_i by 1
0 }$ z8 m+ [! E( I    end
: y# A' \3 V& send. k( [, H5 E/ [$ k- |( t
# V# p9 G$ u- |' D3 u6 c
begin P_pick3 arriving
9 V# l0 I$ e0 n2 d) N    set A_i to 210 A) h/ }" L+ p) j! [
    move into Q_induct3
9 d; ~8 B2 n4 o1 D! L7 S    move into pickaisle.induct3( x4 b, O. C" {! m
    while A_i<=30 do begin
$ {( b* |9 o" M        travel to pickaisle.con(A_i)
% d/ {$ k& N( V) C8 N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  Y& [6 h3 ]  e' l0 b
        else wait for 10 sec
1 S7 l9 M: W4 D0 I        if A_i=A_leave then send to die
% N/ t- h8 M$ W' n& Z, G/ n) l5 x3 ?2 u        else inc A_i by 1
/ R- w0 g* q' g/ O% P3 k- b8 Y    end9 I4 z! ~5 r; R$ B
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是个什么东东?4 m6 c  l5 \' n$ I* S
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ k6 x- @' ~5 `4 C
/ |' X) }3 @% f& |2 e
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
1 _1 N5 c0 G1 L# J% _* O
9 ~: V& O- s* D8 v4 _' ~% g' U另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:0 q* ]: l: {% w/ _
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;4 ^1 V& B. D$ B8 G
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
0 k  j7 [% P: N3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
, \* _6 d' D+ E# W/ c9 Vbegin P_induction arriving8 p% z( w$ M& n: A
    clone 1 load to P_pick(A_induct)8 D7 N- w# H9 e) u
end最大的系7 g- J+ ~. d7 b: L% Y$ c2 a
+ q0 Z! ]! T3 D+ v
begin P_pick arriving/ `% P" W4 O3 V2 X- f, @
    set A_i to procindex * 10 + 12 p' f- w6 H5 M& m, s5 V- M
    move into Q_induct(procindex)
; K1 P' H5 F3 ~' @    move into pickaisle.induct(procindex)5 o8 K: F, I& @- g0 {
    /*check the type of pickaisle.induct(i), for your last problem.*/
6 x+ v+ w+ B/ @. q' _
& f+ Y3 h4 `. e# K- M0 D. g    while A_i<=30 do begin$ j% y% q8 }! r
        travel to pickaisle.con(A_i)" O: T0 y+ C7 E- Q& D+ [( r/ y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! Y2 F2 c& g! D        else wait for 10 sec& L* V& Z; V, P0 ^+ X3 `' q
        if A_i=A_leave then send to die
# N# T5 A, {( h" G2 e: b( F6 ^        else inc A_i by 19 `- ~" u0 X: r. u: ?4 P
    end& `" ^: Z) E. V0 y5 s
end
9 y2 b# ]4 }. Q: ^9 ]. O/ F3 w$ o# o" ?1 [4 y" F
其中的procindex为整形,代表当前process的序号。
4 D/ u3 J" Q1 N! 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-5-25 12:03 , Processed in 0.014689 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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